public void CloseWindow(RandomEvent Event, GameObject Button) { YesNoButtons.Add(Button); gameObject.SetActive(false); gamestate = GameStates.GlobalMap; EventWindow.SetActive(false); foreach (GameObject Btn in YesNoButtons) { Btn.SetActive(false); Destroy(Button); } YesNoButtons.Clear(); if (Event.LaunchNextEvent == true) { foreach (RandomEvent ev in AllEvents) { if (ev.type == Event.NextEvent) { Event.LaunchNextEvent = false; LaunchEvent(ev); break; } } } UpdateResources(); }
IEnumerator ShowText() { for (int i = 0; i < sentences.Length; i++) { Btn.SetActive(false); currentText = sentences.Substring(0, i + 1); UIText.GetComponent <UnityEngine.UI.Text>().text = currentText; yield return(new WaitForSeconds(delay)); if (Input.GetMouseButton(0)) { UIText.GetComponent <UnityEngine.UI.Text>().text = sentences; break; } } showButton(); }
public void showButton() { enter = true; Btn.SetActive(true); }