public Data_Dock() { pnjName = "Adalyn North"; pnj = Data_Tools.FindPnj(pnjName); }
public static Data_Pnj FindPnj(string pName) { Data_Pnj pnj = new Data_Pnj(); string path = MonoData_Tools.pathHDDPnj + pName; if (File.Exists(path)) { int count = 0; StreamReader stream = new StreamReader(path); string _text; while ((_text = stream.ReadLine()) != null) { if (count == 0) { //Debug.Log("TEXT -----> " + _text); //Debug.Log("TEXT Extract -----> " + StringToIntExact(_text)); if (StringToIntExact(_text) == 0) { pnj.HaveQuest = false; } else { pnj.HaveQuest = true; } } else if (count == 1) { if (pnj.HaveQuest) { Debug.LogWarning("QuestId: " + _text); pnj.QuestId = StringToIntExact(_text); pnj.Quete = DecryptingQuest(pnj.QuestId); pnj.DialogueQuete = pnj.Quete.TextQuest; } } else if (count == 2) { if (pnj.HaveQuest) { pnj.DialogueQuete = pnj.Quete.TextQuest; } } else if (count == 3) { pnj.Dialogue = FindDialogueByID(Int32.Parse(_text)); } else if (count == 4) { Debug.Log("On va chercher le sprite"); } count++; } Debug.Log("Quest: " + pnj.QuestId.ToString()); Debug.Log("Dialogue: " + pnj.Dialogue); Debug.Log("DialogueQuete: " + pnj.DialogueQuete); stream.Close(); } else { Debug.LogWarning("File dosen't exist at " + path); } return(pnj); }