Class UnityAssetPrefetcherInstaller
Unity-specific installer for the Asset Prefetcher system.
Handles service creation, dependency injection, and Unity integration.
Namespace: Serenity.AssetPrefetcher.Installation.Installers
Assembly: Serenity.UnityAssetPrefetcher.Installation.dll
Syntax
public class UnityAssetPrefetcherInstaller : AssetPrefetcherInstaller, IFoundationInstaller, IInstaller
Constructors
UnityAssetPrefetcherInstaller(ILogService)
Initializes a new instance of the Unity Asset Prefetcher installer with logging service.
Declaration
public UnityAssetPrefetcherInstaller(ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogService | logService | Logging service for error reporting and debugging |
Methods
Install(AssetPrefetcherInstallerInstallInput)
Installs and configures the Unity Asset Prefetcher system.
Declaration
public override void Install(AssetPrefetcherInstallerInstallInput input)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetPrefetcherInstallerInstallInput | input | Installation input containing configuration parameters |
KickoffPrewarmByLabels(string, string[])
Initiates asset prewarming for the specified labels within a context.
Declaration
public void KickoffPrewarmByLabels(string contextId, string[] labels)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextId | Context identifier for grouping prewarmed assets |
| string[] | labels | Array of Addressables labels to prewarm |
KickoffPrewarmThemeAssets(string, object)
Prefetches all assets referenced in a UnityThemeDefinition.This includes all prefabs from Components and audio clips from Sounds.
Declaration
public void KickoffPrewarmThemeAssets(string contextId, object theme)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextId | Context identifier for grouping theme assets |
| object | theme | Theme definition object containing component and sound references |
SetFallback(PrefetchPolicyProfile)
Sets the fallback profile for default configuration.
Declaration
public void SetFallback(PrefetchPolicyProfile fallback)
Parameters
| Type | Name | Description |
|---|---|---|
| PrefetchPolicyProfile | fallback | Fallback profile ScriptableObject |
SetProvider(AssetPrefetcherLocator)
Sets the provider reference for dependency injection.
Declaration
public void SetProvider(AssetPrefetcherLocator provider)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetPrefetcherLocator | provider | Asset prefetcher locator instance |
SetRegistry(PrefetchPolicyRegistry)
Sets the policy registry for profile resolution.
Declaration
public void SetRegistry(PrefetchPolicyRegistry registry)
Parameters
| Type | Name | Description |
|---|---|---|
| PrefetchPolicyRegistry | registry | Registry containing prefetch policy profiles |