// Use this for initialization void Start() { main_script = GameObject.Find("Main Background").GetComponent <Main_Script>(); main_screen_script = GameObject.Find("Main Screen").GetComponent <Main_screen_Script>(); popup_text = GameObject.Find("Popup_text"); OK_button = GameObject.Find("Popup_OK"); YES_button = GameObject.Find("Popup_YES"); NO_button = GameObject.Find("Popup_NO"); OK_button.GetComponent <Button>().onClick.AddListener(OK_click); YES_button.GetComponent <Button>().onClick.AddListener(YES_click); NO_button.GetComponent <Button>().onClick.AddListener(NO_click); dropdown = GameObject.Find("Popup_dropdown"); OK_drop_button = GameObject.Find("Popup_drop_OK"); }
public void Show_Popup_Text(string rule, string code, Main_Script.Human human) { dropdown.SetActive(false); OK_drop_button.SetActive(false); Set_Popup_Text(code, human); if (rule == "OK") { OK_button.SetActive(true); YES_button.SetActive(false); NO_button.SetActive(false); } else if (rule == "YN") { OK_button.SetActive(false); YES_button.SetActive(true); NO_button.SetActive(true); } }