Skip to main content

INetworkEntity

An interface in Root.Township, Alta.Networking.

The core of a networked entity as seen by the networking code. NetworkEntity implements it.

Properties​

MemberWhat it is
uint Identifier { get; }The entity's network identifier.
bool IsBeingDestroyed { get; set; }True once destruction has started.
bool IsSendingMessages { get; set; }Whether the entity sends its messages.
EntityMessageHandler MessageHandler { get; }Handles the entity's messages by EntityMessageType.
IEnumerable<IPlayer> PlayersSpawnedFor { get; }Players this entity has been spawned for.
Chunk PositionChunk { get; }The chunk its position is written against: the chunking parent's chunk, or its own.
NetworkPrefab Prefab { get; }The entity's network prefab.
string SafeName { get; }A name for logs that works even if the object is destroyed.
SpawnIndex SpawnIndex { get; }Spawn counter used to ignore stale destroy messages.
Transform Transform { get; }The entity's transform.

Events​

MemberWhat it is
event EntityDespawnedHandler DestroyedBySceneRaised when the scene destroys or unloads the entity.

Methods​

MemberWhat it is
void OnDestroyedByScene(bool isUnload)Called when the scene destroys the entity; the flag says if it is an unload.
AltaCoroutine StartCoroutine(IEnumerator enumerator)Starts a coroutine tied to the entity.

Used in​

Members of other types that take, return or hold a INetworkEntity: