void Update() { switch (state) { case ManagerState.Idle: cur_patient.Init(); NextState(); break; case ManagerState.FirstCheckpoint: if (cur_patient.isFirstCheckpoint()) { NextState(); } break; case ManagerState.SecondCheckpoint: if (cur_patient.isSecondCheckpoint()) { NextState(); } break; case ManagerState.ThirdCheckpoint: if (cur_patient.isThirdCheckpoint()) { NextState(); } break; case ManagerState.Complete: SceneManager.LoadScene(next_scene.name); break; default: throw new System.Exception("Error: Reached manager state that's not implemented: " + state); } }