Interface ICharacter
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
CharacterNameLabel
The label displaying the character's name above their model.
WorldLabel CharacterNameLabel { get; set; }
Property Value
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
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
IsSpawned
Whether the character is currently spawned in the world.
bool IsSpawned { get; }
Property Value
IsTeleporting
Whether the character is currently teleporting.
bool IsTeleporting { get; }
Property Value
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
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
flagsCharacterFlagsFlags to disable.
EnableFlags(CharacterFlags)
Enables the specified flags for the character using bitwise operations.
void EnableFlags(CharacterFlags flags)
Parameters
flagsCharacterFlagsFlags 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
raceTemplateRaceTemplateThe race template containing model references.
modelIndexintThe 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
raceTemplateRaceTemplateThe race template containing model references.
modelIndexintThe index of the model to instantiate.
genderCharacterGenderThe 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
triggersList<Trigger>The list of triggers to execute.
eventDataEventDataThe event data to pass to each trigger.
IsFlagged(CharacterFlags)
Checks if the specified flags are enabled for the character.
bool IsFlagged(CharacterFlags flags)
Parameters
flagsCharacterFlagsFlags 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
characterBehaviourICharacterBehaviourThe 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
controlTThe behaviour instance if found, otherwise null.
Returns
- bool
True if the behaviour is found; otherwise, false.
Type Parameters
TThe interface type to retrieve.
UnregisterCharacterBehaviour(ICharacterBehaviour)
Unregisters a character behaviour component from this character.
void UnregisterCharacterBehaviour(ICharacterBehaviour characterBehaviour)
Parameters
characterBehaviourICharacterBehaviourThe behaviour to unregister.