//code to run on start of state private static void OnStart() { //looks for the proper prep code for the current state switch (currentState) { case GameState.MainMenu: WorldRotation.SetRotation(0.0f); break; case GameState.GameStart: ObstacleManager.Create(); WorldRotation.SetRotation(20.0f); break; case GameState.GameOver: break; default: break; } }