Class UnityModalSettings
Unity ScriptableObject for configuring modal dialog settings and parameters.
Provides editor interface for defining modal content, appearance, and behavior.
Integrates with Unity's CreateAssetMenu system and supports signal-based modal triggering.
Implements both IUiShowModalParameters and IFoundationSettings interfaces for system integration.
Namespace: Serenity.Modal.Installation.Settings
Assembly: Serenity.UnityModal.Installation.dll
Syntax
public class UnityModalSettings : ScriptableObject, IUiShowModalParameters, IFoundationSettings
Constructors
UnityModalSettings()
Declaration
public UnityModalSettings()
Fields
showModalParameters
Declaration
public UnityUiShowModalParameters showModalParameters
Field Value
| Type | Description |
|---|---|
| UnityUiShowModalParameters |
signalTypeName
Declaration
public string signalTypeName
Field Value
| Type | Description |
|---|---|
| string |
Properties
Alignment
Gets or sets the alignment configuration for modal content elements.
Declaration
public UiComponentAlignmentType Alignment { get; set; }
Property Value
| Type | Description |
|---|---|
| UiComponentAlignmentType | The alignment type for modal content elements. |
Buttons
Gets or sets the list of button configurations for the modal dialog.
Declaration
public List<SerializedComponentData> Buttons { get; set; }
Property Value
| Type | Description |
|---|---|
| List<SerializedComponentData> | The list of button configurations for the modal dialog. |
DisplaySignalType
Gets a user-friendly display name for the configured signal type.
Returns "<None>" if no signal is configured, "<Invalid>" if the type cannot be resolved.
Declaration
public string DisplaySignalType { get; }
Property Value
| Type | Description |
|---|---|
| string |
Guid
Gets or sets the globally unique identifier for this modal settings instance.
Declaration
public string Guid { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The globally unique identifier for this modal settings instance. |
Id
Gets or sets the unique identifier for this modal settings instance.
Declaration
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The unique identifier for this modal settings instance. |
IsTranslatingText
Gets or sets whether the text content is being translated.
Declaration
public bool IsTranslatingText { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | True if the text content is being translated; otherwise, false. |
IsTranslatingTitle
Gets or sets whether the title is being translated.
Declaration
public bool IsTranslatingTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | True if the title is being translated; otherwise, false. |
ShowModalParameters
Gets or sets the modal parameters containing all configuration data.
Automatically casts between the base and Unity-specific parameter types.
Declaration
public UiShowModalParameters ShowModalParameters { get; set; }
Property Value
| Type | Description |
|---|---|
| UiShowModalParameters | The UnityUiShowModalParameters instance. |
SignalTypeName
Gets or sets the fully qualified type name of the event signal that triggers this modal.
Declaration
public string SignalTypeName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Text
Gets or sets the body text content displayed in the modal dialog.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The body text content of the modal dialog. |
Title
Gets or sets the title text displayed in the modal dialog.
Declaration
public string Title { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The title text of the modal dialog. |
Methods
GetSerializedButtons()
Gets the serialized button data for the modal dialog.
Provides access to button configuration for external systems.
Declaration
public List<SerializedComponentData> GetSerializedButtons()
Returns
| Type | Description |
|---|---|
| List<SerializedComponentData> | A list of serialized button component data. |
GetSignalInstance()
Creates an instance of the configured signal type for event system integration.
Validates that the type exists and is assignable from EventDispatcherSignal.
Returns null if the signal type is not configured or cannot be resolved.
Declaration
public EventDispatcherSignal GetSignalInstance()
Returns
| Type | Description |
|---|---|
| EventDispatcherSignal | An instance of the configured signal type, or null if invalid. |
Remarks
Note: This ScriptableObject uses Debug.LogWarning as fallback since ILogService is not easily injectable into assets. This warning is important for developers to identify misconfigured modal signal types.
ToString()
Returns a string representation of the modal settings configuration.
Includes ID, GUID, title, text, alignment, and button count for debugging purposes.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A formatted string describing the modal settings. |