A class in Root.Township, ATT.PlayerStates.
Grave entity left where a player went down. Server assigns the downed player and syncs it; the grave is destroyed when that player disconnects.
Constructors
| Member | What it is |
|---|
Gravestone() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private IPlayer downedPlayer | Backing field for DownedPlayer. |
private GameObject graveModel | Grave model hidden from the downed player themselves. |
private GameObject revivalBeacon | Revival beacon object hidden from the downed player themselves. |
private MethodSyncStruct<int> syncDownedPlayerIdentifier | Method sync (SyncA) that sends the downed player's identifier. |
Properties
| Member | What it is |
|---|
IPlayer DownedPlayer { get; } | The player this grave belongs to. |
Methods
| Member | What it is |
|---|
void AssignDownedPlayerToGrave(IPlayer player) | Server: sets the downed player and syncs their identifier to clients. |
override void OnDisconnected(Player player) | Destroys the grave when its downed player disconnects. |
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Sets up the method sync for the downed player's identifier. |
private void SyncDownedPlayerIdentifier(IPlayer player, Stream stream, int downedPlayerIdentifier) | Sync handler: on remote clients, looks up the downed player and hides the grave if it is the local player's. |
private void TryDisableGraveVisualsOnClient() | Client: hides the grave model and revival beacon when the grave belongs to the local player. |
Used in
Members of other types that take, return or hold a Gravestone: