Skip to main content

EquipmentState

A class in Root.Township, Alta.PlayerStates.

Player state for the equipment (cosmetics) screen. The local player gets a customization room with a dummy and name board in front of them; others see a remote effect there.

Constructors​

MemberWhat it is
EquipmentState(PlayingState playingState)Creates an EquipmentState from playingState.

Fields​

3 private and internal fields
MemberWhat it is
private PooledObject activeNameThe pooled name board shown above the dummy.
private RemoteEquipmentModeVisuals remoteDummyEffectsThe spawned remote visuals for this player.
private IUnityUpdateMethod updateThe registered UpdateNameBoardPosition method.

Properties​

MemberWhat it is
EquipmentCustomizationRoom CustomizationRoom { get; private set; }The EquipmentCustomizationRoom spawned for the local player.
override string Name { get; set; }"Equipment State".
override PlayerStateType StateType { get; }PlayerStateType.Equipment.
1 private and internal property
MemberWhat it is
private EquipmentStateSettings Settings { get; }The state's EquipmentStateSettings.

Methods​

MemberWhat it is
override bool ValidateStateActivation(bool isDuringLoading)False while loading, true otherwise.
protected override void OnDeactivate()Does nothing.
protected override void OnPlayerControllerFound(PlayerController playerController, bool isFromOnActivate)Local player: spawns the room and name board and adds the back-to-playing transition. Others: spawns the remote dummy effect.
protected override void OnPlayerControllerLost(bool isFromOnDeactivate)Removes the room or the remote effect.
7 private and internal methods
MemberWhat it is
private void DestroyCustomizationDummy()Local player: unlinks the equipment room, stops the name board update and releases the name board.
private void DestroyRemoteEffects(bool isAnimatingEffects)Other players: makes the remote dummy effect disappear, or destroys it straight away.
private Vector3 GetDummySpawnPosition()A point in front of the player's feet, along the head's flat forward, at DummySpawnDistanceFromPlayer.
private void PositionInFrontOfPlayer(Transform transformToPosition)Puts a transform at the dummy spawn position facing the player's feet.
private void SpawnCustomizationDummy()Local player: spawns the equipment room in front of the player and a name board above the dummy.
private void SpawnRemoteDummyEffects(bool isAnimatingEffects)Spawns the effect other players (and the server) see in front of someone in equipment mode.
private void UpdateNameBoardPosition()Each frame keeps the name board above the dummy's head, facing the player.