Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 582 Bytes

README.md

File metadata and controls

25 lines (21 loc) · 582 Bytes

UnityStateMachine

Getting Started

  1. Create a new script and inherit from State
public class JumpingState : State { }
  1. Drag your new state onto a Game Object (A StateMachine should automatically attatch itself)
  2. Create another state and add it to the GameObject
  3. Switch between states by calling SetState()
public class JumpingState : State
{
  public State otherState;

  OnMouseDown()
  {
    SetState(otherState);
  }
}

##Other Information Switch states while editing or playing by clicking the buttons in the editor