Skip to main content

TestingPlayerStates

A class in Root.Township, Alta.PlayerStates.

Test component for player states: inspector buttons fire hurt, die and equipment events, and it puts its state manager into Playing at start.

Constructors​

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

Fields​

MemberWhat it is
static TestingPlayerStates InstanceThe last TestingPlayerStates to wake.
4 private and internal fields
MemberWhat it is
private bool isDyingInspector button that raises Died.
private bool isEquipmentInspector button that raises EnteredEquipment.
private bool isHurtingInspector button that raises Hurt.
private PlayerStateManager stateManagerThe player state manager to drive.

Events​

MemberWhat it is
event Action DiedRaised by the Die inspector button.
event Action EnteredEquipmentRaised by the Equipment inspector button.
event Action HurtRaised by the Hurt inspector button.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Sets Instance.
private void OnValidate()Raises the event for whichever inspector button was pressed.
private void Start()Sets the state manager to Playing.