- Create a new script and inherit from State
public class JumpingState : State { }
- Drag your new state onto a Game Object (A StateMachine should automatically attatch itself)
- Create another state and add it to the GameObject
- 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