logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    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.

    In this article
    © 2026 Serenity. All Rights Reserved