Ejemplo n.º 1
0
    private async void DisplayInstructionsBeforeGame()
    {
        TimeProgress timer = FindObjectOfType <TimeProgress>();

        timer.TogglePause();
        FadingInstructor fade = FindObjectsOfType <FadingInstructor>().First(fi => fi.name.Equals("Instructions"));

        Time.timeScale = 0f;
        fade.Fade(initialInstructionDuration, initialInstructionFadeDuration);
        await new WaitForSecondsRealtime(initialInstructionDuration + initialInstructionFadeDuration);
        Time.timeScale = 1f;
        timer.TogglePause();
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (!inMinigame || minigameEnded)
        {
            return;
        }

        if (KeyIsDown(pauseKeyCodes))
        {
            timer.TogglePause();
        }
        else if (KeyIsDown(winKeyCodes))
        {
            minigameEnded = true;
            minigameManager.WinMinigame();
        }
        else if (KeyIsDown(loseKeyCodes))
        {
            minigameEnded = true;
            minigameManager.LoseMinigame();
        }
    }