Class UnityMusicPlayerInstaller
Unity-specific installer for the music player system, extending the base MusicPlayerInstaller.
Handles complete setup of music player services, gateways, factories, and preloading functionality.
Manages Unity Addressables asset loading for audio settings and music track definitions.
Provides asynchronous music track preloading to prevent runtime performance issues during playback.
Namespace: Serenity.MusicPlayer.Installation.Installers
Assembly: Serenity.UnityMusicPlayer.Installation.dll
Syntax
public class UnityMusicPlayerInstaller : MusicPlayerInstaller, IFoundationInstaller, IInstaller
Constructors
UnityMusicPlayerInstaller(IEventDispatcherService, IGameSettingsService, ILogService, IServiceLocator)
Initializes a new instance of UnityMusicPlayerInstaller with required services.
Sets up dependency injection for event dispatcher, game settings, and logging services.
Prepares the installer for complete music player system installation.
Declaration
public UnityMusicPlayerInstaller(IEventDispatcherService eventDispatcherService, IGameSettingsService gameSettingsService, ILogService logService, IServiceLocator serviceLocator = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IEventDispatcherService | eventDispatcherService | Service for event handling and dispatching. |
| IGameSettingsService | gameSettingsService | Service for game settings management. |
| ILogService | logService | Service for logging and error reporting. |
| IServiceLocator | serviceLocator | Optional service locator that receives the installed IMusicPlayerService for runtime resolution by event-dispatcher actions. |
Methods
Install(ILogService)
Performs complete installation of the music player system.
Orchestrates the installation of factories, services, gateways, and use cases in proper sequence.
Ensures all music player components are configured and ready for use throughout the application.
Declaration
public override void Install(ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogService | logService | Log service instance for installation process logging. |
InstallFactories(ILogService)
Installs all required factories for the music player system.
Creates and configures UnityAudioPlayerEmitterFactory and UnityMusicPlayerServiceFactory with dependencies.
Sets up the UnityMusicPlayerGatewayFactory for gateway creation and management.
Establishes the factory infrastructure needed for music player service instantiation.
Declaration
protected override void InstallFactories(ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogService | logService | Log service instance for factory installation logging. |
InstallGateway(Dictionary<string, IMusicPlayerService>)
Installs the music player gateway using the factory and configured services.
Creates the gateway instance that will handle routing of music player operations to appropriate services.
Completes the gateway layer setup for the music player system architecture.
Declaration
protected override void InstallGateway(Dictionary<string, IMusicPlayerService> services)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, IMusicPlayerService> | services | Dictionary of music player services to be managed by the gateway. |