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