Skip to main content

PlayingState

A class in Root.Township, Alta.PlayerStates.

The player state for normally playing in the world. On the server, entering it spawns a player controller for the player's mode and adds transitions to combat, downed, customization and spirit.

Constructors​

MemberWhat it is
PlayingState()Creates a PlayingState with default values.

Properties​

MemberWhat it is
bool IsRespawning { get; set; }Set by the dead to playing transition so the new controller spawns at the respawn point.
override string Name { get; set; }Display name, "Playing State".
PlayingStateSettings Settings { get; }The state's settings cast to PlayingStateSettings.
override PlayerStateType StateType { get; }Always PlayerStateType.Playing.

Methods​

MemberWhat it is
override void SyncStateEnter(Stream stream)Sends nothing extra when entering.
override void SyncStateLeave(Stream stream)Sends nothing extra when leaving.
protected override void OnActivate()Server: spawns a new player controller and adds the transitions out of playing.
protected override void OnActivateRemote(bool isPlayerCharacterSpawned)Client: adds the transition to the equipment state for the local player.
protected override void OnDeactivateRemote(bool isPlayerCharacterSpawned)Client: removes the equipment transition for the local player.
protected override void OnDecorated(IPlayerState baseState, IPlayerState decorator)Server: turns off the playing to combat transition while another state (other than equipment) decorates this one.
protected override void OnDecoratedRemote(IPlayerState baseState, IPlayerState decorator)Client: turns off the equipment transition for the local player while decorated.
protected override void OnUndecorated(IPlayerState baseState, IPlayerState decorator)Server: turns the combat transition back on when a non-equipment decorator is removed.
protected override void OnUndecoratedRemote(IPlayerState baseState, IPlayerState decorator)Client: turns the equipment transition back on for the local player.
1 private and internal method
MemberWhat it is
private void SpawnPlayerController()Spawns the player controller prefab for the player's mode (VR, flat and so on), as a respawn if IsRespawning.

Used in​

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