Abstract layer of State Machine. With example of use.
After creating all scripts, it's very easy to change states just in the inspector (by drag&drop scriptableObjects without coding).
- Create script
Manager.cs
and inherit fromAStateMachine.cs
- Create script
Action.cs
and inherit fromAAction.cs
- Create script
Decision.cs
and inherit fromADecision.cs
- Create script
State.cs
and inherit fromAState.cs
- Create scriptableObjects of
Action
,Decision
,State
. - Setup
State
byAction
andDecision
- Add
Manager
to character and putState
to theManager.DefaultState
Create partial
StateMashine.cs
for easy adding new features through creating new scripts