Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (!inGameUIScripts.blurStand & paused)
        {
            Time.timeScale = 0;
        }

        timeLeft -= Time.deltaTime;

        inGameUIScripts.setTimeLeft(timeLeft);
        inGameUIScripts.showCountDown(timeLeft, win, lose);



        //if not win and not lose
        if (!win & !lose)
        {
            lose |= timeLeft < 0;
            if (lose)
            {
                Lose();
            }
            else if (Input.GetKeyDown(KeyCode.Space))
            {
                Win();
            }
        }
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        timeLeft -= Time.deltaTime;

        Debug.Log(timeLeft);

        inGameUIScripts.showCountDown(timeLeft, win);
        //if lose
        if (!win)
        {
            lose |= timeLeft < 0;
            if (lose)
            {
                Lose();
            }
            else if (Input.GetKeyDown(KeyCode.Space))
            {
                Win();
            }
        }
    }