Transition¶
Transitions should always be referenced through methods provided by State.
All Transition methods return the Transition object itself so that its methods can be chained.
Methods¶
If(System.Func<bool> condition)AndIf(System.Func<bool> condition)OrIf(System.Func<bool> condition)IfSignalCaught(string signal)AndIfSignalCaught(string signal)OrIfSignalCaught(string signal)After(float duration)AndAfter(float duration)OrAfter(float duration)AfterOneFrame()AfterNFrames(int n)ThenDo(System.Action onTransition)AlsoDo(System.Action onTransition)InsteadDo(System.Action onTransition)
Method Reference¶
-
If(System.Func<bool> condition)¶
Defines an If transition between states. Performs the transition if the function given as argument returns true.
-
AndIf(System.Func<bool> condition)¶
Adds an additional condition to a transition. Performs the transition if the previous condition and the given function are both true.
-
OrIf(System.Func<bool> condition)¶
Adds an additional condition to a transition. Performs the transition if the previous condition or the given function returns true.
-
IfSignalCaught(string signal)¶
Defines an IfSignalCaught transition between states. Performs the transition if a matching signal is sent through the state machine.
-
AndIfSignalCaught(string signal)¶
Adds an additional condition to a transition. Performs the transition if the previous condition is true and a matching signal is sent through the state machine.
-
OrIfSignalCaught(string signal)¶
Adds an additional condition to a transition. Performs the transition if the previous condition is true or a matching signal is sent through the state machine.
-
After(float duration)¶
Defines an After transition between states. Performs the transition after the given amount of time (in seconds) has passed.
-
AndAfter(float duration)¶
Adds an additional condition to a transition. Performs the transition if the previous condition is true and the given amount of time (in seconds) has passed.
-
OrAfter(float duration)¶
Adds an additional condition to a transition. Performs the transition if the previous condition is true or the given amount of time (in seconds) has passed.
-
AfterOneFrame()¶
Defines an AfterOneFrame transition. Performs the transition after a single Update has been completed.
-
AfterNFrames(int n)¶
Defines an AfterNFrames transition. Performs the transition after n updates
have been completed.
-
ThenDo(System.Action onTransition)¶
Defines a ThenDo callback on the transition. Executes the given callback when the transition is performed. Executed between OnExit of the previous state and OnEnter of the new state.
-
AlsoDo(System.Action onTransition)¶
Adds an additional callback on the transition. Will be executed after the originally defined callback given by ThenDo.
-
InsteadDo(System.Action onTransition)¶
Overwrites the callback on the transition. This callback will be executed instead of the originally defined callback.
Property Reference¶
-
Transition With Returns: The Transition itself.
Used as part of the ReplaceTransitionCondition idiom.