public void Add_TextCode(string code, Main_Script.Human human) { string tmp = CodeToText(code, human); eventlog_text_fullarray[eventlog_text_fullarray.Count - 1] += tmp; eventlog_text_fullarray[eventlog_text_fullarray.Count - 1] += "\n"; EL_text.text = eventlog_text_fullarray[eventlog_text_fullarray.Count - 1]; }
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); } }
public string CodeToText(string code, Main_Script.Human human) { string tmp = dictionary_replics[code]; string whattosearch; whattosearch = "[name]"; if (tmp.IndexOf(whattosearch) >= 0) { tmp = tmp.Replace(whattosearch, human.name + " " + human.surname); } whattosearch = "[age]"; if (tmp.IndexOf(whattosearch) >= 0) { tmp = tmp.Replace(whattosearch, human.age.years + ""); } whattosearch = "[c_education.name]"; if (tmp.IndexOf(whattosearch) >= 0) { tmp = tmp.Replace(whattosearch, human.education.current_education.name + ""); } whattosearch = "[c_education.education_given]"; if (tmp.IndexOf(whattosearch) >= 0) { string temp = ""; if (human.education.current_education.education_given == 1) { temp = "primary school"; } else if (human.education.current_education.education_given == 2) { temp = "secondary school"; } else if (human.education.current_education.education_given == 3) { temp = "high school"; } tmp = tmp.Replace(whattosearch, temp + ""); } return(tmp); }
public void Set_Popup_Text(string code, Main_Script.Human human) { string tmp = main_screen_script.CodeToText(code, human); popup_text.GetComponent <Text>().text = tmp; }