Skip to main content

DeadStateSettings

A class in Root.Township, Alta.PlayerStates.

Settings asset for the player's dead state (DeadState): ragdoll feel, the fade and respawn timing, and which stats are reset on death.

Constructors​

MemberWhat it is
DeadStateSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

10 private and internal fields
MemberWhat it is
private DeathAnimationSettings animationSettingsDeath animation settings.
private float deadBodyDragRigidbody drag on the dead body (default 0.5).
private GameAction diedActionGame action counted for the player each time they die.
private float fadeInOutTimeSeconds of fade to black before respawn (default 0.5).
private ShowNames showNamesActionShowNames action run on death.
private float skirtRotationMultiplierMultiplier for the rotation given to the body on death (default 1).
private StatThresholdValue[] statsToModifyOnDeathStats set to threshold values on death.
private StatDefinition[] statsToResetOnDeathStats reset on death.
private float timeToIncreaseFogSeconds of fog build-up before the respawn wait (default 1).
private float timeToRespawnSeconds after the fog before the server starts the respawn fade (default 5).

Properties​

MemberWhat it is
DeathAnimationSettings AnimationSettings { get; }Death animation settings for the body.
float DeadBodyDrag { get; }Rigidbody drag applied to the dead body. Defaults to 0.5.
GameAction DiedAction { get; }Game task action counted for the player each time they die.
float FadeInOutTime { get; }Seconds for the screen fade to black before respawn.
ShowNames ShowNamesAction { get; }Show-names action run when the player dies.
float SkirtRotationMultiplier { get; }Scales the spin given to the body when it falls.
override Type StateType { get; }Always DeadState.
StatThresholdValue[] StatsToModifyOnDeath { get; }Stats moved to set threshold values on death.
StatDefinition[] StatsToResetOnDeath { get; }Saved stats reset to their defaults on death. Unsaved and duplicate entries are dropped in the editor.
float TimeToIncreaseFog { get; }Seconds the fog closes in after death. The server waits this plus TimeToRespawn before fading.
float TimeToRespawn { get; }Extra seconds after the fog before the respawn fade starts. Defaults to 5.

Methods​

1 private and internal method
MemberWhat it is
private void OnValidate()Removes duplicates and stats that aren't save serialized from statsToResetOnDeath.

Used in​

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