Click or drag to resize

TimedStateTrackerTStateDataStartState Method (TStateData, Single, Action)

Starts a state, and returns a token that can be used to stop it again.

Namespace:  Gamelogic.Extensions
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public IStateToken<TStateData> StartState(
	TStateData stateData,
	float maxTime,
	Action onTimeOut
)

Parameters

stateData
Type: TStateData
Custom state data. This is useful in cases where all the active states needs to be examined. For example, this data can be used to identify states externally.
maxTime
Type: SystemSingle
The maximum amount of time this state should survive past the current time.
onTimeOut
Type: SystemAction
The action to perform when timing out.

Return Value

Type: IStateTokenTStateData
A token that wraps the custom state data and can be used to stop the state started with this method.
Remarks
For a state to time out, it is necessary for the Update method to be called regularly (for example, in a MonoBehaviours Update method).
See Also