Skip to main content

INetworkEntityBehaviour

An interface in Root.Township, Alta.Networking.

Implement on a component of a NetworkEntity prefab to get the entity's network lifecycle calls (initialise, server spawn, player connect and disconnect).

Properties​

MemberWhat it is
NetworkEntity Entity { get; }The entity this behaviour belongs to.

Methods​

MemberWhat it is
void Initialize()Called on both sides when the entity is set up for networking. Create your message syncs here.
void InitializeAsServer(SpawnData spawnData)Server: called when the entity is first spawned, with the spawn data.
void OnConnected(Player player)Called when a player starts receiving this entity.
void OnDisconnected(Player player)Called when a player stops receiving this entity.