void Update() { switch (currentState) { case States.Start: OnStartEvent.Invoke(); break; case States.Playing: OnPlayingEvent.Invoke(); break; case States.End: OnEndEvent.Invoke(); break; } }
// Update is called once per frame void Update() { switch (currentState) { case States.Start: OnStartEvent.Invoke(); break; case States.Playing: OnPlayingEvent.Invoke(); break; case States.End: OnEndEvent.Invoke(); break; default: throw new ArgumentOutOfRangeException(); } }