logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityCharacterPresenter

    Instance-based presenter that creates an CharacterViewModel from the supplied ICharacterArchetypeConfig (Application) and binds it to the view. Depends only on InterfaceAdapters abstractions (ICharacterView) and Application/Domain types — no Infrastructure references. Instantiated once by the installer and injected via delegates.

    Inheritance
    object
    UnityCharacterPresenter
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Character.InterfaceAdapters.Presenters
    Assembly: Serenity.UnityCharacter.InterfaceAdapters.dll
    Syntax
    public class UnityCharacterPresenter

    Constructors

    UnityCharacterPresenter()

    Declaration
    public UnityCharacterPresenter()

    Methods

    Bind(ICharacterView, int)

    Creates a new CharacterViewModel from the given archetype config, binds it to the view, and returns it for external systems (wave, combat, etc.).

    Declaration
    public CharacterViewModel Bind(ICharacterView view, int MaxHealth)
    Parameters
    Type Name Description
    ICharacterView view

    The view abstraction on the spawned prefab instance.

    int MaxHealth
    Returns
    Type Description
    CharacterViewModel

    The freshly created and bound ViewModel.

    Rebind(ICharacterView, int)

    Unbinds the current ViewModel from the view, creates a fresh ViewModel from the given archetype config, and rebinds it. Used when reusing a pooled character instance for a new spawn.

    Declaration
    public CharacterViewModel Rebind(ICharacterView view, int MaxHealth)
    Parameters
    Type Name Description
    ICharacterView view

    The view abstraction on the pooled prefab instance.

    int MaxHealth
    Returns
    Type Description
    CharacterViewModel

    The freshly created and bound ViewModel.

    In this article
    © 2026 Serenity. All Rights Reserved