Class UnityUiInputComponentFactory
Factory for creating Unity UI input components with TextMeshPro input field configuration.
Handles instantiation, initialization, and setup of text input components including character limits and default values.
Integrates with the Serenity component factory system to provide standardized input field creation.
Implements
Inherited Members
Namespace: Serenity.Ui.Infrastructure.Components.Factories
Assembly: Serenity.UnityUi.Infrastructure.dll
Syntax
public class UnityUiInputComponentFactory : IUiComponentFactory
Constructors
UnityUiInputComponentFactory(UnityViewElementFactory)
Initializes the input component factory with Unity view element factory dependency.
Sets up the factory with the required view element creation capabilities for input component instantiation.
Declaration
public UnityUiInputComponentFactory(UnityViewElementFactory unityViewElementFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityViewElementFactory | unityViewElementFactory | Factory for creating Unity view elements |
Methods
CreateUiComponent<Element, Parameters, Actions>(Parameters, Actions, IFoundationViewElement, ILogService)
Creates and configures a Unity UI input component from template with full initialization.
Instantiates the input component GameObject, applies parameters and actions, and performs specialized input field setup.
Throws exceptions for invalid component types, null templates, or missing GameObjects to ensure reliable component creation.
Declaration
public Element CreateUiComponent<Element, Parameters, Actions>(Parameters parameters, Actions actions, IFoundationViewElement template, ILogService logService) where Element : IFoundationViewElement where Parameters : IUiComponentParameters where Actions : IUiComponentActions
Parameters
| Type | Name | Description |
|---|---|---|
| Parameters | parameters | Configuration parameters for the input component |
| Actions | actions | Action handlers for input component interactions |
| IFoundationViewElement | template | Template foundation view element for component instantiation |
| ILogService | logService | Logging service for error reporting and debugging |
Returns
| Type | Description |
|---|---|
| Element | Fully configured Unity UI input component ready for use |
Type Parameters
| Name | Description |
|---|---|
| Element | The target UI component element type |
| Parameters | The component parameters type |
| Actions | The component actions type |
Exceptions
| Type | Condition |
|---|---|
| Exception | Thrown when component type is unsupported, template is null, or GameObject creation fails |