A class in Root.Township, Alta.QuickAccessActions.
A networked, saved stand-in for a player (a dummy with a name, title and member status) that the Show Names action labels like a real player. The server syncs its fields to clients.
Constructors
| Member | What it is |
|---|
PlayerProxy() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private Transform head | Backing field for Head. |
private PlayerSubscriberStatus status | Backing field for Status. |
private MethodSync sync | Method sync for the name, title and status message. |
private string title | Backing field for Title. |
private string userName | Backing field for UserName. |
Properties
| Member | What it is |
|---|
Transform Head { get; } | Transform the name board is placed above. |
static HashSet<PlayerProxy> PlayerProxies { get; } | Every live proxy. Read by Show Names each frame to place name boards. |
PlayerSubscriberStatus Status { get; } | Member status shown on the proxy's shield. |
string Title { get; } | Title text for the proxy. Saved and synced. |
string UserName { get; } | Name shown for the proxy. Saved and synced. |
Methods
| Member | What it is |
|---|
override void Initialize() | Creates the SyncNameProxy method sync used to send the name, title and status. |
override void OnConnected(Player player) | Sends the name, title and status to a player who just connected. |
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Adds the proxy to PlayerProxies. |
private void OnDestroy() | Removes the proxy from PlayerProxies. |
private void Sync(IPlayer player, Stream stream) | Serializes user name, title and status. Remote clients apply the received status. |
Used in
Members of other types that take, return or hold a PlayerProxy: