Table of Contents

Interface ICharacter

Namespace
FishMMO.Shared.Core
Assembly
FishMMO.Shared.dll

Interface for a character entity in the game world. Defines core properties, state management, and behaviour registration for all character types.

public interface ICharacter
Extension Methods

Properties

CharacterGuildLabel

The label displaying the character's guild above their model.

WorldLabel CharacterGuildLabel { get; set; }

Property Value

WorldLabel

CharacterNameLabel

The label displaying the character's name above their model.

WorldLabel CharacterNameLabel { get; set; }

Property Value

WorldLabel

Collider

The collider for the character.

Collider Collider { get; set; }

Property Value

Collider

Flags

Bitwise flags representing the character's state.

int Flags { get; set; }

Property Value

int

GameObject

The GameObject associated with the character.

GameObject GameObject { get; }

Property Value

GameObject

ID

Unique identifier for the character.

long ID { get; set; }

Property Value

long

IsSpawned

Whether the character is currently spawned in the world.

bool IsSpawned { get; }

Property Value

bool

IsTeleporting

Whether the character is currently teleporting.

bool IsTeleporting { get; }

Property Value

bool

MeshRoot

The root transform for the character's mesh/model hierarchy.

Transform MeshRoot { get; }

Property Value

Transform

Name

The character's display name.

string Name { get; }

Property Value

string

NetworkObject

The network object representing this character in FishNet networking.

NetworkObject NetworkObject { get; }

Property Value

NetworkObject

Observers

The set of network connections observing this character.

HashSet<NetworkConnection> Observers { get; }

Property Value

HashSet<NetworkConnection>

Owner

The network connection that owns this character.

NetworkConnection Owner { get; }

Property Value

NetworkConnection

PredictionManager

The prediction manager for client-side prediction and reconciliation.

PredictionManager PredictionManager { get; }

Property Value

PredictionManager

Transform

The transform of the character.

Transform Transform { get; }

Property Value

Transform

Methods

DisableFlags(CharacterFlags)

Disables the specified flags for the character using bitwise operations.

void DisableFlags(CharacterFlags flags)

Parameters

flags CharacterFlags

Flags to disable.

EnableFlags(CharacterFlags)

Enables the specified flags for the character using bitwise operations.

void EnableFlags(CharacterFlags flags)

Parameters

flags CharacterFlags

Flags to enable.

InstantiateRaceModelFromIndex(RaceTemplate, int)

Instantiates the character's race model prefab at the specified index and attaches it to the mesh root.

void InstantiateRaceModelFromIndex(RaceTemplate raceTemplate, int modelIndex)

Parameters

raceTemplate RaceTemplate

The race template containing model references.

modelIndex int

The index of the model to instantiate.

InstantiateRaceModelFromIndex(RaceTemplate, int, CharacterGender)

Instantiates the character's race model prefab at the specified gender and index and attaches it to the mesh root.

void InstantiateRaceModelFromIndex(RaceTemplate raceTemplate, int modelIndex, CharacterGender gender)

Parameters

raceTemplate RaceTemplate

The race template containing model references.

modelIndex int

The index of the model to instantiate.

gender CharacterGender

The model gender to request.

Invoke(List<Trigger>, EventData)

Executes each trigger in the list with the supplied event data. Null-safe: no-ops if triggers or eventData is null.

void Invoke(List<Trigger> triggers, EventData eventData)

Parameters

triggers List<Trigger>

The list of triggers to execute.

eventData EventData

The event data to pass to each trigger.

IsFlagged(CharacterFlags)

Checks if the specified flags are enabled for the character.

bool IsFlagged(CharacterFlags flags)

Parameters

flags CharacterFlags

Flags to check.

Returns

bool

True if the flags are enabled; otherwise, false.

RegisterCharacterBehaviour(ICharacterBehaviour)

Registers a character behaviour component for this character. Enables behaviour-based extension and modular logic.

void RegisterCharacterBehaviour(ICharacterBehaviour characterBehaviour)

Parameters

characterBehaviour ICharacterBehaviour

The behaviour to register.

TryGet<T>(out T)

Attempts to get a registered character behaviour of type T. Returns true if found, with the behaviour in the out parameter.

bool TryGet<T>(out T control) where T : class, ICharacterBehaviour

Parameters

control T

The behaviour instance if found, otherwise null.

Returns

bool

True if the behaviour is found; otherwise, false.

Type Parameters

T

The interface type to retrieve.

UnregisterCharacterBehaviour(ICharacterBehaviour)

Unregisters a character behaviour component from this character.

void UnregisterCharacterBehaviour(ICharacterBehaviour characterBehaviour)

Parameters

characterBehaviour ICharacterBehaviour

The behaviour to unregister.