Skip to main content

PlayerComponent

A class in Root.Township, the global namespace.

Base for components on the Player object (the player's network entity, not their body). Player calls InitializeComponent on each one.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private Player playerBacking field for Player, filled from the same GameObject.

Properties​

MemberWhat it is
Player Player { get; }The Player on the same object.

Methods​

MemberWhat it is
void InitializeComponent(IPlayer newIPlayer)Hooks PlayerLoadComplete to the player's LoadComplete event.
protected virtual void PlayerLoadComplete()Called when the player has finished loading. Empty by default.

Used in​

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