Example #1
0
        public string GetJson()
        {
            SerializeableQuestLog myClone = new SerializeableQuestLog();

            myClone.quests = quests.ToArray();
            return(UnityEngine.JsonUtility.ToJson(myClone));
        }
Example #2
0
        public static QuestLog FromJson(string json)
        {
            SerializeableQuestLog myClone = UnityEngine.JsonUtility.FromJson <SerializeableQuestLog>(json);
            QuestLog questlog             = new QuestLog {
            };

            questlog.Initialize(myClone.quests.Length);
            for (int i = 0; i < myClone.quests.Length; i++)
            {
                questlog.quests[i] = myClone.quests[i];
            }
            return(questlog);
        }