protected void Toggle() { Lights = Lights switch { StopState _ => new GetReadyToGoState(), GetReadyToGoState _ => new GoState(), GoState _ => new GetReadyToStopState(), GetReadyToStopState _ => new StopState(), _ => throw new ArgumentOutOfRangeException(nameof(Lights)) }; } }
// Use this for initialization void Start() { InState = GoState.Hiden; }