Пример #1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            bool menuIsActive = restartButton.activeSelf;
            restartButton.SetActive(!menuIsActive);
        }

        if (currentTime > levelDurationInSeconds && !gameFinished)
        {
            gameFinished = true;
            Scenes.INSTANCE.EndLevel();
            scoreDisplay.ShowScore(score, maxScore);
        }

        currentTime += Time.deltaTime;
    }