public static Data_Quests FindQuestByID(int IDquest) { Data_Quests quest = null; string path = MonoData_Tools.pathHDDQuestes + IDquest; if (File.Exists(path)) { quest.ID = IDquest; int count = 0; StreamReader stream = new StreamReader(path); string _text; while ((_text = stream.ReadLine()) != null) { if (count == 0) { quest.Type = IDquest; } else if (count == 1) { quest.ItemNecessary = FindNameObjectByID(Int32.Parse(_text)); } count++; } } return(quest); }
public static Data_Quests DecryptingQuest(int IDquest) { Data_Quests quest = new Data_Quests(); string path = MonoData_Tools.pathHDDQuestes + IDquest; if (File.Exists(path)) { int count = 0; StreamReader stream = new StreamReader(path); string _text; while ((_text = stream.ReadLine()) != null) { if (count == 0) { quest.ID = Int32.Parse(_text); } else if (count == 1) { quest.ItemNecessary = FindNameObjectByID(Int32.Parse(_text)); } else if (count == 2) { quest.ItemCount = Int32.Parse(_text); } else if (count == 3) { Debug.LogWarning("TExtQuest: " + _text); quest.TextQuest = FindDialogueByID(Int32.Parse(_text)); } count++; } stream.Close(); return(quest); } else { Debug.LogWarning("Quest doesn't exist in path " + path); } return(null); }