private static void ChangeState(State newState) { // exit old state behaviour switch (_state) { case State.Idle: break; case State.Simulating: Simulation.Exit(); break; case State.ViewingData: LogLoader.Exit(); break; case State.EditingRobot: break; case State.EditingEnvironment: break; } _state = newState; // enter new state behaviour switch (newState) { case State.Idle: break; case State.Simulating: Simulation.Enter(); break; case State.ViewingData: LogLoader.Enter(); break; case State.EditingRobot: break; case State.EditingEnvironment: break; } Debug.Log("BotNavSim: " + state.ToString()); }