CustomizationState
A class in Root.Township, Alta.PlayerStates.
The player state for the character customization room. The client spawns the room and a customization controller; when the player finishes, the server saves their cosmetics and moves them to playing.
- Listed in Players and characters
- Inherits or implements
PlayerStateBase - Derived types
CustomizationToPlayingTransition,FirstJoinToCustomizationTransition,PlayingToCustomizationTransition - Documented in Player states
Constructors
| Member | What it is |
|---|---|
CustomizationState(IPostProcessController postProcessController) | Creates a CustomizationState from postProcessController. |
Fields
4 private and internal fields
| Member | What it is |
|---|---|
private CustomizationPlayerController customizationController | The local customization player controller while the room is open. |
private CosmeticCustomizationManager customizationRoom | The spawned CosmeticCustomizationManager room. |
private static readonly Logger logger | Class logger. |
private readonly IPostProcessController postProcessController | Post processing controller, reset when the room opens. |
Properties
| Member | What it is |
|---|---|
override string Name { get; set; } | "Customization State". |
override PlayerStateType StateType { get; } | PlayerStateType.Customization. |
1 private and internal property
| Member | What it is |
|---|---|
private CustomizationStateSettings Settings { get; } | The state's CustomizationStateSettings (room prefab, position, fade time and so on). |
Methods
| Member | What it is |
|---|---|
protected override void OnActivate() | Server: loads the chunk at the player's spawn position if they are not in one yet. |
protected override async void OnActivateRemote(bool isPlayerCharacterSpawned) | Client, local player: spawns the customization room and controller, then resets post processing. |
protected override void OnDeactivate() | Server: counts a finish customization action for the player. |
protected override void OnDeactivateRemote(bool isPlayerCharacterSpawned) | Client, local player: fades out, unlinks and destroys the customization controller and room. |
protected override async void Sync(IPlayer player, Stream stream) | Sends the chosen cosmetics. On the server it checks them, saves them, syncs them to others and starts the customization to playing transition. |