public static QuestTree LoadFile() { QuestTree tree = new QuestTree(); string[] files = Directory.GetFiles(Application.dataPath + "/Quests/", "*.json"); foreach (string filepath in files) { StreamReader reader = new StreamReader(filepath, System.Text.Encoding.UTF8); string json = reader.ReadToEnd(); Quest quest = new Quest(); quest.fromJson(JSON.Parse(json)); tree.AddQuest(quest); reader.Close(); } return(tree); }