Example #1
0
    IEnumerator ShowDeathScreen(string message)
    {
        deathScreen.alpha = 0;
        gameOver.alpha    = 0;
        gameOver.gameObject.GetComponent <Text>().text = message;
        deathScreen.gameObject.SetActive(true);
        restartButton.gameObject.SetActive(false);
        float time    = 0;
        float timeMax = 5f;

        while (time / timeMax <= 1)
        {
            deathScreen.alpha = Mathf.Lerp(0, 1, time / timeMax);
            time += Time.deltaTime;
            yield return(null);
        }
        time    = 0;
        timeMax = 3;
        while (time / timeMax <= 1)
        {
            gameOver.alpha = Mathf.Lerp(0, 1, time / timeMax);
            time          += Time.deltaTime;
            yield return(null);
        }
        restartButton.gameObject.SetActive(true);
        StaticUI.ShowCursor(true);
    }
Example #2
0
 void PrepareScene()
 {
     StaticUI.ShowCursor(false);
     EventManager.instance.FireEvent("Music_Start");
 }
Example #3
0
 void ShowEscape(bool show)
 {
     ESC_Panel.SetActive(show);
     Time.timeScale = show ? 0 : 1;
     StaticUI.ShowCursor(show);
 }