// Use this for initialization void Start() { fSMMachine = new FSMMachine <StateExample>("Example"); fSMMachine.DefaultState = StateExample.LightOffOn; fSMMachine.AddStatus(StateExample.LightOffOn, new LightingSwitchOffState()); fSMMachine.AddStatus(StateExample.LightColorSwitch, new LightingColorChangeState(Color.red)); fSMMachine.Run(); StartCoroutine(ChangeState()); }