NetworkEntityComponentController
A class in Root.Township, Alta.Networking.
Turns lists of components on or off depending on whether this is the server or a client, and whether the player entity is the local player or a remote one.
- Listed in Networking and servers
- Inherits or implements
MonoBehaviour,IInitializeAsLocalPlayer,IInitializeAsRemotePlayer - Attributes
RequireComponent
Constructors
| Member | What it is |
|---|---|
NetworkEntityComponentController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
Methods
5 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks up to the entity's InitializationFinished event. |
private void IInitializeAsLocalPlayer.InitializeAsLocalPlayer(PlayerController player) | Turns on the local behaviours and turns off the remote ones. |
private void IInitializeAsRemotePlayer.InitializeAsRemotePlayer(PlayerController player) | Turns on the remote behaviours and turns off the local ones. |
private void SetBehavioursEnabled(NetworkEntity entity) | After init, turns server behaviours on only on the server and client behaviours only on clients. Skipped in local test. |
private void SetComponentsEnabled(IEnumerable<Behaviour> components, bool isEnabled) | Sets enabled on each component in the list. |