Skip to content

jushii/StateMachineController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

State Machine Controller for Unity

StateMachineController is a modular finite state machine (FSM) controller for Unity.

Features

  • Modular FSM system
  • Pass custom arguments when changing states
  • Supports multiple state machines
Example 1 - Changing the active state.
this.StateMachine.ChangeState(typeof(StatePlayerTurn));
Example 2 - Passing data when changing the state.
SpellData spellData = new SpellData()
{
   attackPower = 120,
   coolDown = 5
};

this.StateMachine.ChangeState(typeof(StateCastingSpell), spellData);
Example 3 - Changing the active state machine.
this.StateMachine.ChangeStateMachine(typeof(BattleModeStateMachine), typeof(StateBattleStart));