void Start() { if (GameObject.FindGameObjectWithTag("Player") != null) { system = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GameController>(); emotion = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterEmotion>(); phone = GameObject.FindGameObjectWithTag("PhoneCanvas").GetComponent <PhoneCanvas>().phone; } }
void Start() { system = GameObject.FindGameObjectWithTag("Mobile").GetComponent <PhoneManage>(); }
void Start() { phone = GameObject.FindGameObjectWithTag("PhoneCanvas").GetComponent <PhoneCanvas>().phone; }
public void LoadData(int t) { system = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GameController>(); emotion = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterEmotion>(); phone = GameObject.FindGameObjectWithTag("PhoneCanvas").GetComponent <PhoneCanvas>().phone; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(PlayerPrefs.GetString("save")); XmlNodeList dataList = xmlDoc.GetElementsByTagName("profile" + t); string questType = ""; foreach (XmlNode dataInfo in dataList) { XmlNodeList dataContent = dataInfo.ChildNodes; foreach (XmlNode dataItems in dataContent) { if (dataItems.Name == "score") { system.setScore(int.Parse(dataItems.InnerText)); } if (dataItems.Name == "Questtype") { questType = dataItems.InnerText; } if (dataItems.Name == "QuestID") { system.changeCurrentMission(int.Parse(dataItems.InnerText)); } if (dataItems.Name == "questItem") { FindingQuest raw = (FindingQuest)(system.getCurrentQuest()); XmlNodeList dataContentInventory = dataItems.ChildNodes; foreach (XmlNode dataItemInventory in dataContentInventory) { raw.setAllCurrentItemisCollect(int.Parse(dataItemInventory.Attributes["ID"].Value)); } system.setCurrentMission(raw); } if (dataItems.Name == "courage") { emotion.characterDetail.setEncouragementStat(int.Parse(dataItems.InnerText)); } if (dataItems.Name == "bravery") { emotion.characterDetail.setBraveryStat(int.Parse(dataItems.InnerText)); } if (dataItems.Name == "trustness") { emotion.characterDetail.setTrustnessStat(int.Parse(dataItems.InnerText)); } if (dataItems.Name == "previous_map") { system.previousMap = dataItems.InnerText; } if (dataItems.Name == "victimList") { XmlNodeList dataContentInventory = dataItems.ChildNodes; foreach (XmlNode dataItemInventory in dataContentInventory) { system.setVictimisHelpbyID(int.Parse(dataItemInventory.Attributes["ID"].Value), true); } } if (dataItems.Name == "doc") { XmlNodeList dataContentInventory = dataItems.ChildNodes; foreach (XmlNode dataItemInventory in dataContentInventory) { phone.docManager.collectDoc(int.Parse(dataItemInventory.Attributes["ID"].Value), true); } } if (dataItems.Name == "haveConveration") { XmlNodeList dataContentInventory = dataItems.ChildNodes; Quest temps = system.getCurrentQuest(); foreach (XmlNode dataItemInventory in dataContentInventory) { temps.setConversationFinish(int.Parse(dataItemInventory.Attributes["MapID"].Value), bool.Parse(dataItemInventory.Attributes["haveCon"].Value)); } system.setCurrentMission(temps); } if (dataItems.Name == "smartSystem") { XmlNodeList dataContentInventory = dataItems.ChildNodes; foreach (XmlNode dataItemInventory in dataContentInventory) { system.setsmartValue(dataItemInventory.Attributes["MapID"].Value, int.Parse(dataItemInventory.Attributes["value"].Value)); } } } } Destroy(gameObject); }