Class UnityModalInstaller
Unity-specific installer for modal system components and services.
Handles dependency injection setup for modal services, controllers, factories, and UI components.
Manages modal settings loading and instantiation of modal dialogs based on configuration data.
Integrates with Unity Input System and provides comprehensive validation of dependencies.
Namespace: Serenity.Modal.Installation.Installers
Assembly: Serenity.UnityModal.Installation.dll
Syntax
public class UnityModalInstaller : ModalInstaller<InputAction, InputAction.CallbackContext>, IFoundationInstaller, IInstaller
Constructors
UnityModalInstaller(UnityModalInstallerInput)
Initializes a new instance of the UnityModalInstaller with required dependencies.
Performs comprehensive validation of input parameters and stores references for modal system setup.
Ensures all required services and factories are available before proceeding with installation.
Declaration
public UnityModalInstaller(UnityModalInstallerInput input)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityModalInstallerInput | input | Input DTO containing all required dependencies for modal installation. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when input or required dependencies are null. |
Methods
Install(ModalInstallerInstallInput<InputAction, CallbackContext>)
Installs the complete modal system including factories, services, and controllers.
Disables Unity navigation events and sets up all modal components in proper dependency order.
Creates modal service and controller instances with proper initialization and parenting.
Declaration
public override void Install(ModalInstallerInstallInput<InputAction, InputAction.CallbackContext> input)
Parameters
| Type | Name | Description |
|---|---|---|
| ModalInstallerInstallInput<InputAction, CallbackContext> | input | Input data containing installation configuration parameters. |
InstallModals()
Loads and instantiates modal dialogs from configuration settings.
Searches for modal settings in addressable assets and creates modal instances from templates.
Validates modal configuration data and logs errors for invalid or missing settings.
Prevents duplicate installation by checking the modals installed flag.
Declaration
public void InstallModals()