logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface ICharacterView

    Abstraction for character views used by the Presenter layer. Lives in InterfaceAdapters so the Presenter can depend on it without referencing Infrastructure (Dependency Inversion). Concrete implementations (e.g., UnityCharacterView) live in Infrastructure.

    Namespace: Serenity.Character.InterfaceAdapters.Views
    Assembly: Serenity.UnityCharacter.InterfaceAdapters.dll
    Syntax
    public interface ICharacterView

    Properties

    ViewModel

    The currently bound ViewModel, or null if not bound.

    Declaration
    CharacterViewModel ViewModel { get; }
    Property Value
    Type Description
    CharacterViewModel

    Methods

    Bind(CharacterViewModel)

    Binds an CharacterViewModel to this view. Called once at spawn time by the Presenter.

    Declaration
    void Bind(CharacterViewModel viewModel)
    Parameters
    Type Name Description
    CharacterViewModel viewModel

    The ViewModel created from the archetype config.

    RefreshDebugFields()

    Syncs presentation state from the current ViewModel. Call after ViewModel mutations (e.g., damage) to keep visuals up to date.

    Declaration
    void RefreshDebugFields()

    Unbind()

    Clears the current ViewModel binding so this view can be reused from a pool. Safe to call even if the view is not currently bound.

    Declaration
    void Unbind()
    In this article
    © 2026 Serenity. All Rights Reserved