Class UnityCharacterSpawnServiceBuilder
Builds the character spawn service: the pool every spawned character goes through, bound to the presenter that gives each instance its view model, and taught every archetype the installer discovered.
Inherited Members
Namespace: Serenity.Character.Installation.Installers
Assembly: Serenity.UnityCharacter.Installation.dll
Syntax
public class UnityCharacterSpawnServiceBuilder
Remarks
The pool's binding delegates live here because this assembly is the one that can see both the pool and the presenter; the pool itself stays unaware of the interface adapters layer. Archetypes are registered by their Id, the key a spawn request names. When two archetypes claim the same Id the first one discovered keeps it and the later one is skipped with a warning naming both, so a copied config never silently replaces the one a spawn request meant.
Constructors
UnityCharacterSpawnServiceBuilder()
Declaration
public UnityCharacterSpawnServiceBuilder()
Methods
Build(GameObject, IReadOnlyList<CharacterConfigSO>, ILogService)
Adds the spawn service to serviceObject and registers every archetype.
Declaration
public UnityCharacterPoolService Build(GameObject serviceObject, IReadOnlyList<CharacterConfigSO> archetypes, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | serviceObject | The object the spawn service lives on; it is destroyed with it. |
| IReadOnlyList<CharacterConfigSO> | archetypes | The discovered character configs. Null entries are skipped. |
| ILogService | logService | Reports skipped archetypes and unbindable instances. May be null. |
Returns
| Type | Description |
|---|---|
| UnityCharacterPoolService | The initialized spawn service. |