JUtils
A unity utilities library
JUtils.State< T1, T2, T3 > Class Template Referenceabstract

A simple state that can be driven by stateMachine More...

Inheritance diagram for JUtils.State< T1, T2, T3 >:
Collaboration diagram for JUtils.State< T1, T2, T3 >:

Protected Member Functions

void Deactivate ()
 Deactivate this state and make the state-machine continue its queue More...
 
abstract void OnActivate ()
 Gets called when the state activates More...
 
abstract void OnDeactivate ()
 Gets called when the sate deactivates More...
 
StateRef< T > Ref< T > ()
 Used for making typed argument adding to states prettier More...
 
virtual void ActiveUpdate ()
 Only runs the Update() function when the state is active More...
 
virtual void Awake ()
 
virtual void Update ()
 
override void OnActivate ()
 
abstract void OnActivate (T param)
 
override void OnActivate ()
 
abstract void OnActivate (T1 param1, T2 param2)
 
override void OnActivate ()
 
abstract void OnActivate (T1 param1, T2 param2, T3 param3)
 

Properties

bool isActive [get]
 
bool isActivating [get]
 Is set to true while the state is activating More...
 
bool isDeactivating [get]
 Is set to true while the state is deactivating More...
 
StateMachine stateMachine [get, set]
 The reference of this state's state machine More...
 
float timeInState [get]
 Get the amount of seconds that this state is active. Returns 0 if the state is not active More...
 
float unscaledTimeInState [get]
 Get the amount of unscaled seconds that this state is active. Returns 0 if the state is not active More...
 
StateData stateData [get]
 

Events

Action< StateonStateActivate
 
Action< StateonStateDeactivate
 

Detailed Description

A simple state that can be driven by stateMachine

State with 3 type-safe arguments

State with 2 type-safe arguments

State with 1 type-safe arguments

Member Function Documentation

◆ ActiveUpdate()

virtual void JUtils.State< T1, T2, T3 >.ActiveUpdate ( )
inlineprotectedvirtual

Only runs the Update() function when the state is active

Here is the caller graph for this function:

◆ Awake()

virtual void JUtils.State< T1, T2, T3 >.Awake ( )
inlineprotectedvirtual

◆ Deactivate()

void JUtils.State< T1, T2, T3 >.Deactivate ( )
inlineprotected

Deactivate this state and make the state-machine continue its queue

References JUtils.StateMachine.ContinueQueue(), JUtils.State< T1, T2, T3 >.isActive, and JUtils.State< T1, T2, T3 >.stateMachine.

Here is the call graph for this function:

◆ OnActivate() [1/7]

abstract void JUtils.State< T1, T2, T3 >.OnActivate ( )
protectedpure virtual

Gets called when the state activates

Here is the caller graph for this function:

◆ OnActivate() [2/7]

override void JUtils.State< T1, T2, T3 >.OnActivate ( )
inlineprotected

References JUtils.State< T1, T2, T3 >.OnActivate(), and JUtils.State< T1, T2, T3 >.stateData.

Here is the call graph for this function:

◆ OnActivate() [3/7]

override void JUtils.State< T1, T2, T3 >.OnActivate ( )
inlineprotected

References JUtils.State< T1, T2, T3 >.OnActivate(), and JUtils.State< T1, T2, T3 >.stateData.

Here is the call graph for this function:

◆ OnActivate() [4/7]

override void JUtils.State< T1, T2, T3 >.OnActivate ( )
inlineprotected

References JUtils.State< T1, T2, T3 >.OnActivate(), and JUtils.State< T1, T2, T3 >.stateData.

Here is the call graph for this function:

◆ OnActivate() [5/7]

abstract void JUtils.State< T1, T2, T3 >.OnActivate ( param)
protectedpure virtual

◆ OnActivate() [6/7]

abstract void JUtils.State< T1, T2, T3 >.OnActivate ( T1  param1,
T2  param2 
)
protectedpure virtual

◆ OnActivate() [7/7]

abstract void JUtils.State< T1, T2, T3 >.OnActivate ( T1  param1,
T2  param2,
T3  param3 
)
protectedpure virtual

◆ OnDeactivate()

abstract void JUtils.State< T1, T2, T3 >.OnDeactivate ( )
protectedpure virtual

Gets called when the sate deactivates

◆ Ref< T >()

StateRef<T> JUtils.State< T1, T2, T3 >.Ref< T > ( )
inlineprotected

Used for making typed argument adding to states prettier

Template Parameters
TThe type we want the ref from
StateMachine.AddToQueue(Ref&#60;TeleportState>, location);

>

Type Constraints
T :State 

◆ Update()

virtual void JUtils.State< T1, T2, T3 >.Update ( )
inlineprotectedvirtual

References JUtils.State< T1, T2, T3 >.ActiveUpdate(), and JUtils.State< T1, T2, T3 >.isActive.

Here is the call graph for this function:

Property Documentation

◆ isActivating

bool JUtils.State< T1, T2, T3 >.isActivating
get

Is set to true while the state is activating

◆ isActive

bool JUtils.State< T1, T2, T3 >.isActive
get

◆ isDeactivating

bool JUtils.State< T1, T2, T3 >.isDeactivating
get

Is set to true while the state is deactivating

◆ stateData

StateData JUtils.State< T1, T2, T3 >.stateData
getprotected

◆ stateMachine

StateMachine JUtils.State< T1, T2, T3 >.stateMachine
getset

The reference of this state's state machine

◆ timeInState

float JUtils.State< T1, T2, T3 >.timeInState
get

Get the amount of seconds that this state is active. Returns 0 if the state is not active

◆ unscaledTimeInState

float JUtils.State< T1, T2, T3 >.unscaledTimeInState
get

Get the amount of unscaled seconds that this state is active. Returns 0 if the state is not active

Event Documentation

◆ onStateActivate

Action<State> JUtils.State< T1, T2, T3 >.onStateActivate

◆ onStateDeactivate

Action<State> JUtils.State< T1, T2, T3 >.onStateDeactivate

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