internal void EndLevel() { int sNumber = SceneManager.sceneCount; if (endingLevel) { return; } endingLevel = true; if ((nextLevel = SceneManager.GetActiveScene().buildIndex + 1) >= sNumber) { nextLevel = 0; UIMessageSystem.Message("Congratulations you winned the game\nYou Are Awesome\n (press any key to restart)"); } else { UIMessageSystem.Message("Congratulations you finnished the level\nYou Are Awesome\n (press any key to continue)"); } StartCoroutine(ChangeLevelDelayed()); }
public void Awake() { messageSender = this; this.gameObject.SetActive(false); }