/** * Called each frame update */ private void Update() { // Do any update-level operations required in the current state currentState?.UpdateState(); // Check for keyboard input if (!Application.isEditor || !Input.GetKeyDown(KeyCode.K)) { return; } switch (currentState?.GetType().Name) { case nameof(RunState): // For now, this will skip to the run stats state (in case one of the fish gets stuck or something like that school.KillAllActive(); break; } }
/** * Called each frame update */ private void Update() { // do any update-level operations required in the current state if (currentState != null) { currentState.UpdateState(); } // check for keyboard input if (Input.GetKeyDown(KeyCode.Escape)) { switch (currentState.GetType().Name) { case nameof(RunState): // for now, this will skip to the run stats state (in case one of the fish gets stuck or something like that school.KillAllActive(); break; } } }