Skip to main content

Gravestone

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​

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

Fields​

4 private and internal fields
MemberWhat it is
private IPlayer downedPlayerBacking field for DownedPlayer.
private GameObject graveModelGrave model hidden from the downed player themselves.
private GameObject revivalBeaconRevival beacon object hidden from the downed player themselves.
private MethodSyncStruct<int> syncDownedPlayerIdentifierMethod sync (SyncA) that sends the downed player's identifier.

Properties​

MemberWhat it is
IPlayer DownedPlayer { get; }The player this grave belongs to.

Methods​

MemberWhat 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
MemberWhat 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: