Class UnityAppReadinessGate
Unity implementation of IAppReadinessGate that manages application startup synchronization.
Initializes Addressables, preloads specified assets, prewarms Unity Timeline assets,
and ensures stable frame rates before signaling the application is ready for user interaction.
Uses a timeout mechanism to prevent infinite waiting during startup.
Implements
Inherited Members
Namespace: Serenity.Global.Infrastructure.Services
Assembly: Serenity.UnityGlobal.Infrastructure.dll
Syntax
public class UnityAppReadinessGate : IAppReadinessGate
Constructors
UnityAppReadinessGate(ILogService)
Initializes a new instance of UnityAppReadinessGate with the specified logging service.
Declaration
public UnityAppReadinessGate(ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogService | logService | Service for logging readiness gate operations and warnings |
Methods
WaitUntilReadyAsync(AppReadinessOptions, CancellationToken)
Waits until the application is ready by performing initialization steps and ensuring stable performance.
- Initializes Unity Addressables system
- Preloads assets specified by keys/labels in options
- Prewarms Timeline assets if specified in hints
- Waits for stable frame rates within performance thresholds
- Performs final end-of-frame synchronization
Declaration
public Task WaitUntilReadyAsync(AppReadinessOptions options = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AppReadinessOptions | options | Configuration options for readiness checking, or null for defaults |
| CancellationToken | cancellationToken | Cancellation token to abort the readiness wait |
Returns
| Type | Description |
|---|---|
| Task | Task that completes when the application is ready for user interaction |