BGC Tools
|
This class is implemented by states that are use din game. It comes with access to state machine related functions once it has been added to the machine. Users must implement OnEnter and OnExit. Users can override Update if they have a function they want to call on a frame by frame basis. More...
Public Member Functions | |
State () | |
Create a state with the default name More... | |
State (string name) | |
Create a state with a custom name rather than the default More... | |
void | OnEnter () |
Called when the state is entered More... | |
void | OnExit () |
Called when the state is exited, before the next state is entered More... | |
virtual void | Update () |
This can be called every frame or whenever for complex states that have behavior on a frame by X basis. More... | |
void | SetVerbose (bool isVerbose) |
Set whether the state machine is verbose or not More... | |
Protected Member Functions | |
abstract void | OnStateEnter () |
Called when the state is entered More... | |
virtual void | OnStateExit () |
Called when the state is exited before the next state is entered More... | |
Protected Attributes | |
virtual string | DefaultName => "State" |
Properties | |
string | Name [get, private set] |
Name of the state. This will either be user defined or the default state name depending on the constructor used More... | |
Private Attributes | |
bool | verbose = false |
This class is implemented by states that are use din game. It comes with access to state machine related functions once it has been added to the machine. Users must implement OnEnter and OnExit. Users can override Update if they have a function they want to call on a frame by frame basis.
|
inline |
Create a state with the default name
Definition at line 28 of file State.cs.
|
inline |
Create a state with a custom name rather than the default
Definition at line 37 of file State.cs.
|
inline |
Called when the state is entered
Definition at line 46 of file State.cs.
Referenced by BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.ExecuteTransitions(), and BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.Update().
|
inline |
Called when the state is exited, before the next state is entered
Definition at line 59 of file State.cs.
|
protectedpure virtual |
Called when the state is entered
Implemented in BGC.StateMachine.TriggeringUpdatingLambdaState< TTriggerEnum >, BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >, BGC.StateMachine.TriggeringLambdaState< TTriggerEnum >, BGC.StateMachine.LambdaState, and BGC.StateMachine.EmptyState.
|
inlineprotectedvirtual |
Called when the state is exited before the next state is entered
Reimplemented in BGC.StateMachine.TriggeringUpdatingLambdaState< TTriggerEnum >, BGC.StateMachine.TriggeringLambdaState< TTriggerEnum >, BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >, and BGC.StateMachine.LambdaState.
|
inline |
Set whether the state machine is verbose or not
isVerbose |
Definition at line 90 of file State.cs.
Referenced by BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddState().
|
inlinevirtual |
This can be called every frame or whenever for complex states that have behavior on a frame by X basis.
Reimplemented in BGC.StateMachine.TriggeringUpdatingLambdaState< TTriggerEnum >, and BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.
|
protected |
|
getprivate set |