public void CloseMenu() { foreach (Controller controller in SpawnHandler.GetAllControllers()) { controller.PauseController(false); } terrain.GetComponent <TerrainFader>().PartiallyFade(1f); objectives.GetComponent <ObjectiveHandler>().PartiallyFade(1f); helpText.color = new Color(helpText.color.r, helpText.color.g, helpText.color.b, 1f); active.SetActive(false); cooldown = 20; inMenu = false; }
void ShowMenu() { foreach (Controller controller in SpawnHandler.GetAllControllers()) { controller.PauseController(true); } terrain.GetComponent <TerrainFader>().PartiallyFade(0.5f); objectives.GetComponent <ObjectiveHandler>().PartiallyFade(0.5f); helpText.color = new Color(helpText.color.r, helpText.color.g, helpText.color.b, 0.5f); active.SetActive(true); cooldown = 20; inMenu = true; }
// Update is called once per frame void Update() { if (smallCubeObjectiveMet && bigCubeObjectiveMet) { foreach (IFadeable fader in levelGameObject.GetComponentsInChildren(typeof(IFadeable))) { StartCoroutine(fader.FadeOut()); } foreach (Controller controller in SpawnHandler.GetAllControllers()) { StartCoroutine(controller.FadeOut()); } StartCoroutine(LoadNextLevel()); } }