Skip to main content

LocalPlayer

A class in Root.Township, the global namespace.

Player prefab component that turns on localOnly objects for the local player and remoteOnly objects for other players. Client.

Constructors​

MemberWhat it is
LocalPlayer()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private GameObject[] localOnlyObjects shown only on the local player.
private PlayerController playerControllerThe PlayerController on the same object.
private GameObject[] remoteOnlyObjects shown only on other players.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Runs Setup now if the player is already linked, otherwise when it links to the local player.
private void IBuildRendererPostBake.PostBake()Build step that drops null entries from both lists.
private void Setup()Activates localOnly or remoteOnly objects depending on whether this is the local player.