Base class for a state When making states for your statemachine, you need to inherit this class. Please do not maintain unnessary references to states in your gameplay code, allow the statemachine framework to manage the states.
More...
|
| BaseFSMState () |
| Default constructor for the state. In your inherited class, you can create constructors with different parameters to represent entry points. Calling a transition to that state with arguments will use the constructor matching those arguments More...
|
|
virtual void | SetupDefinition (ref FSMStateType stateType, ref List< System.Type > children) |
| Sets up the structure of the state. Determines if it has children, and if the state is an OR vs AND state. More...
|
|
virtual void | Enter () |
| Enter() is called when the statemachine enters this state More...
|
|
virtual void | Update () |
| Update() is called if this state is active when the statemachine updates More...
|
|
virtual void | Exit () |
| Exit() is called when the statemachine exits this stage More...
|
|
virtual void | ReceiveMessage (object[] args) |
| ReceiveMessage will be called when a message is broadcasted to the statemachine while this state is active More...
|
|
void | _InternalSetOwnerLogic (FSMStateMachineLogic ownerLogic) |
| Internal system function, do not call this from your gameplay code! More...
|
|
bool | DoTransition (System.Type nextState, object[] args=null) |
| You can call DoTransition to transition your state to another state 'nextState' should be a sibling state of the current state, ie in the statemachine definition, the nextState and this state are children of the same parent. More...
|
|
BaseFSMState | GetParentState () |
| Gets the parent state that this state is a child of. More...
|
|
FSMStateMachine | GetStateMachine () |
| Gets the statemachine that this state belongs to. More...
|
|
|
void | BroadcastMessage (object[] args) |
| This function can be used to broadcast a message to all active states in the statemachine. ReceiveMessage(..) will be called on all active states with the specified arguments. More...
|
|
Base class for a state When making states for your statemachine, you need to inherit this class. Please do not maintain unnessary references to states in your gameplay code, allow the statemachine framework to manage the states.
FSMHelper.BaseFSMState.BaseFSMState |
( |
| ) |
|
Default constructor for the state. In your inherited class, you can create constructors with different parameters to represent entry points. Calling a transition to that state with arguments will use the constructor matching those arguments
Internal system function, do not call this from your gameplay code!
void FSMHelper.BaseFSMState.BroadcastMessage |
( |
object[] |
args | ) |
|
|
protected |
This function can be used to broadcast a message to all active states in the statemachine. ReceiveMessage(..) will be called on all active states with the specified arguments.
- Parameters
-
args | The arguments to send in the message. |
bool FSMHelper.BaseFSMState.DoTransition |
( |
System.Type |
nextState, |
|
|
object[] |
args = null |
|
) |
| |
You can call DoTransition to transition your state to another state 'nextState' should be a sibling state of the current state, ie in the statemachine definition, the nextState and this state are children of the same parent.
- Parameters
-
nextState | The state you need to transition to. This should a sibling of the current state, ie in the statemachine definition, the current state nextState are children of the same parent. |
args | These arguments will be used to choose which constructor of the next state will be called. |
- Returns
- Returns if the transition was successful or not.
virtual void FSMHelper.BaseFSMState.Enter |
( |
| ) |
|
|
virtual |
virtual void FSMHelper.BaseFSMState.Exit |
( |
| ) |
|
|
virtual |
Gets the parent state that this state is a child of.
- Returns
- Returns the parent state. This will be null at the root of the statemachine.
Gets the statemachine that this state belongs to.
- Returns
- Returns the statemachine.
virtual void FSMHelper.BaseFSMState.ReceiveMessage |
( |
object[] |
args | ) |
|
|
virtual |
ReceiveMessage will be called when a message is broadcasted to the statemachine while this state is active
virtual void FSMHelper.BaseFSMState.SetupDefinition |
( |
ref FSMStateType |
stateType, |
|
|
ref List< System.Type > |
children |
|
) |
| |
|
virtual |
Sets up the structure of the state. Determines if it has children, and if the state is an OR vs AND state.
- Parameters
-
stateType | States of type OR means that only one of its children is active at any one time. Type AND means all its children states are active |
children | The list of child states for this state. If the state type is OR, the first child in this list will be the initial active state. |
virtual void FSMHelper.BaseFSMState.Update |
( |
| ) |
|
|
virtual |
The documentation for this class was generated from the following file:
- E:/UnityProjects/GameTools/Assets/FSMHelper/Library/BaseFSMState.cs