Hexagon
Loading...
Searching...
No Matches
Hexagon.StateMachine.State Class Referenceabstract

Base class for a state within a state machine. More...

Public Member Functions

virtual void Init (StateMachine machine)
 Initializes the state with a reference to its owning state machine.
 
void Init ()
 Called during initialization of the state.
 
void OnTransitionToStarted ()
 Called when state becomes the target state of the State Machine. Weight becomes 0. Transition has started.
 
virtual void OnTransitionToFinished ()
 Called when state becomes the current state of the State Machine. Weight becomes 1. Transition has ended.
 
void OnTransitionFromStarted ()
 Called when state starts to lose weight to the target state of the State Machine. Weight becomes 1. Transition has started.
 
virtual void OnTransitionFromFinished ()
 Called when state becomes the previous state of the State Machine. Weight becomes 0. Transition has ended.
 
void OnUpdate ()
 Called once per frame to update state logic.
 
virtual void OnFixedUpdate ()
 Called once per physics update to update state logic.
 
bool IsPossibleChangeFrom ()
 Returns whether a transition from this state is allowed.
 
bool IsPossibleChangeTo ()
 Returns whether a transition to this state is allowed.
 
virtual void DrawGizmos ()
 Called to draw debug gizmos for the state.
 
bool IsMachine< TParent > ()
 Checks if the machine is of a specific generic type.
 
StateMachine< TParent > GetMachine< TParent > ()
 Returns the owning state machine cast to a specific generic type.
 

Public Attributes

StateMachine _machine
 Reference to the owning state machine.
 
int _type
 Integer identifier for the state.
 

Properties

float ActiveTime [get]
 Time in seconds since the state became active.
 
float Weight = 1.0f [get, set]
 Weight of the state in blending operations. Typically between 0 and 1.
 

Detailed Description

Base class for a state within a state machine.

Member Function Documentation

◆ DrawGizmos()

virtual void Hexagon.StateMachine.State.DrawGizmos ( )
inlinevirtual

Called to draw debug gizmos for the state.

◆ GetMachine< TParent >()

StateMachine< TParent > Hexagon.StateMachine.State.GetMachine< TParent > ( )
inline

Returns the owning state machine cast to a specific generic type.

Type Constraints
TParent :class 

◆ Init() [1/2]

void Hexagon.StateMachine.State.Init ( )
abstract

Called during initialization of the state.

◆ Init() [2/2]

virtual void Hexagon.StateMachine.State.Init ( StateMachine machine)
inlinevirtual

Initializes the state with a reference to its owning state machine.

◆ IsMachine< TParent >()

bool Hexagon.StateMachine.State.IsMachine< TParent > ( )
inline

Checks if the machine is of a specific generic type.

Type Constraints
TParent :class 

◆ IsPossibleChangeFrom()

bool Hexagon.StateMachine.State.IsPossibleChangeFrom ( )
abstract

Returns whether a transition from this state is allowed.

◆ IsPossibleChangeTo()

bool Hexagon.StateMachine.State.IsPossibleChangeTo ( )
abstract

Returns whether a transition to this state is allowed.

◆ OnFixedUpdate()

virtual void Hexagon.StateMachine.State.OnFixedUpdate ( )
inlinevirtual

Called once per physics update to update state logic.

◆ OnTransitionFromFinished()

virtual void Hexagon.StateMachine.State.OnTransitionFromFinished ( )
inlinevirtual

Called when state becomes the previous state of the State Machine. Weight becomes 0. Transition has ended.

◆ OnTransitionFromStarted()

void Hexagon.StateMachine.State.OnTransitionFromStarted ( )
abstract

Called when state starts to lose weight to the target state of the State Machine. Weight becomes 1. Transition has started.

◆ OnTransitionToFinished()

virtual void Hexagon.StateMachine.State.OnTransitionToFinished ( )
inlinevirtual

Called when state becomes the current state of the State Machine. Weight becomes 1. Transition has ended.

◆ OnTransitionToStarted()

void Hexagon.StateMachine.State.OnTransitionToStarted ( )
abstract

Called when state becomes the target state of the State Machine. Weight becomes 0. Transition has started.

◆ OnUpdate()

void Hexagon.StateMachine.State.OnUpdate ( )
abstract

Called once per frame to update state logic.

Member Data Documentation

◆ _machine

StateMachine Hexagon.StateMachine.State._machine

Reference to the owning state machine.

◆ _type

int Hexagon.StateMachine.State._type

Integer identifier for the state.

Property Documentation

◆ ActiveTime

float Hexagon.StateMachine.State.ActiveTime
get

Time in seconds since the state became active.

◆ Weight

float Hexagon.StateMachine.State.Weight = 1.0f
getset

Weight of the state in blending operations. Typically between 0 and 1.


The documentation for this class was generated from the following file: