Ejemplo n.º 1
0
    public void BackToPreviousEvent(bool backToBeginning = false)
    {
        // Log the question
        Debug.Log("Back to Previous Event clicked");
        log.Info("Back to Previous Event clicked");

        if (previousQuestions.Count == 0 || backToBeginning)
        {
            // Flush the Stack
            previousQuestions.Clear();

            this.GetComponent <FadingElementUI>().fadeOutCanvas();
            cameraControl.FocusOnOverviewPoint();
            timeController.gameTime = 1f;

            // Unblock the camera
            cameraControl.UnblockPlayerControls();

            // Resume the game
            if (timeController != null)
            {
                timeController.PauseGame(false);
            }

            // Load the first scenario
            scenarioController.LoadFirstScenario();
        }
        else if (previousQuestions.Count > 0)
        {
            // Go to previous question on the stack
            SimQuestion q = previousQuestions.Pop();
            timeController.gameTime = q.time;
            ShowQuestionCanvas(q);
        }
    }