Exemple #1
0
        /// <summary>
        /// Handles a stage change
        /// </summary>
        private void HandleStageChange()
        {
            switch (Stage)
            {
            case GameStage.Record:
                FreezeCam();
                EnableRecordables();                              // enable recordables for simulation
                Time.timeScale = Misc.Constants.SIMULATION_SPEED; // simulate as fast as possible
                Recorder.gameObject.SetActive(true);              // enables the Recorder object
                Simulation.gameObject.SetActive(true);            // enables simulation
                break;

            case GameStage.Replay:
                Replayer.gameObject.SetActive(true);     // activate the replayer object in order to activate the update of this script. Update is executed only if the script is enabled
                break;

            case GameStage.Planning:
                Time.timeScale = 0;                  // pause time for the duration of the planning
                Planning.gameObject.SetActive(true); // activating the Planning object also activates this scripts Update method
                break;

            case GameStage.End:
                PauseMenu.BringEndScreen(Winner);
                break;
            }
            IsStageChanged = false; // stage change has been handled
        }