示例#1
0
    void Update()
    {
        DisplayTime();

        if (GlobalCountDown.TimeLeft.Seconds > 0)
        {
            lossText.SetActive(false);
        }

        // if timer hits 0
        // show losstimer text
        // disable player movement
        if (GlobalCountDown.TimeLeft.Seconds <= 0)
        {
            lossText.SetActive(true);
            losstime -= Time.deltaTime;
            GameObject.Find("Pupple - Player").GetComponent <PlayerGridMovement>().enabled = false;

            // reset scene after delay
            if (losstime <= 0)
            {
                Debug.Log("reset");
                GlobalCountDown.StartCountDown(System.TimeSpan.FromMinutes(2));
                SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
            }
        }

        //Reset Function
        if (Input.GetKeyDown("r"))
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
        }
    }
示例#2
0
    void Start()
    {
        GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(9));
        //PlayerPrefs.SetInt("Level2", 0);
        if (unansweredQuestions == null || unansweredQuestions.Count == 0)
        {
            unansweredQuestions = questions.ToList <Question> ();
        }

        SetCurrentQuestion();
    }
示例#3
0
    void Start()
    {
        GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(12));          //set the amount of time that the player has to finish the level

        if (unansweredQuestions == null || unansweredQuestions.Count == 0)
        {
            unansweredQuestions = questions.ToList <Question>();
        }

        SetCurrentQuestion();
    }
示例#4
0
    //public string timeLeft = GlobalCountDown.FromSeconds.ToString("mm:ss");

    //string timeLeft = GlobalCountDown.TimeLeft.TotalSeconds().ToString("D2");

    void Start()
    {
        GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(14));          //set the amount of time that the player has to finish the level
        //string timeLeft = GlobalCountDown.TimeLeft.TotalSeconds(8).ToString("D2");

        PlayerPrefs.SetInt("Level2", 0);
        CheckCurrentLevel();
        if (unansweredQuestions == null || unansweredQuestions.Count == 0)
        {
            unansweredQuestions = questions.ToList <Question> ();
        }
        SetCurrentQuestion();
    }
示例#5
0
    // Start is called before the first frame update
    void Start()
    {
        Scene currentScene = SceneManager.GetActiveScene();

        if (currentScene == SceneManager.GetSceneByName("OpeningHint"))
        {
            GlobalCountDown.StartCountDown(TimeSpan.FromMinutes(30));
        }

        SaveTimeToFile(currentScene);

        //For testing
        //GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(10));
    }
示例#6
0
    // THIS SCRIPT GOES ON MAIN MENU CANVAS

    public void StartGame()
    {
        SceneManager.LoadScene(2);
        GlobalCountDown.StartCountDown(System.TimeSpan.FromMinutes(2));
    }