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); }
void PrepareScene() { StaticUI.ShowCursor(false); EventManager.instance.FireEvent("Music_Start"); }
void ShowEscape(bool show) { ESC_Panel.SetActive(show); Time.timeScale = show ? 0 : 1; StaticUI.ShowCursor(show); }