Namespace Serenity.Character.Infrastructure.Services
Classes
UnityCharacterPoolService
Unity implementation of ICharacterSpawnService for characters. Owns all character pooling, instantiation, and GameObject lifecycle. Uses injected delegates for ViewModel binding to avoid circular assembly dependencies with InterfaceAdapters. Delegates receive Application-layer ICharacterConfig — no Infrastructure types leak into the bind contract. Per architecture Rule 3.3: Character module owns instantiation/pooling. It also resolves authored content to the key a character was registered under (ICharacterKeyResolver), so a wave entry naming an actor prefab spawns the registered character whose config names that prefab. And it tells a caller, with every spawn, whether a refusal was already reported (IReportingCharacterSpawner), so a wave that forfeits a refused actor does not report the same cause again.
UnityCharacterPoolService.PooledCharacter
Tracks a single pooled character instance and its runtime state.
UnityCharacterService
Unity MonoBehaviour implementation of ICharacterService. Manages per-character state using a dictionary keyed by CharacterId. Stores archetype SO references for Unity-only data access (prefab, death window).
Delegates
UnityCharacterPoolService.BindDelegate
Delegate that binds a fresh ViewModel to a newly instantiated character GameObject. Called when a brand-new instance is created from a prefab. The implementation lives in the installer (which can reference InterfaceAdapters).
UnityCharacterPoolService.RebindDelegate
Delegate that rebinds a pooled character GameObject with a fresh ViewModel. Called when reusing an inactive pooled instance.
UnityCharacterPoolService.UnbindDelegate
Delegate that unbinds the ViewModel from an character GameObject. Called when returning an instance to the pool.