public string SaveData() { PlayerSave playerSave = new PlayerSave(Player); List <DormSave> dormSaves = dorm.Save(); PosSave playerPos = new PosSave(Pos.position, MapEvents.ActiveMap, MapEvents.CurrentMap.transform.name); HomeSave homeSave = StartHomeStats.Save(); VoreSaves voreSaves = voreChar.Save; FullSave fullSave = new FullSave(playerSave, playerPos, dormSaves, homeSave, voreSaves, MapEvents.GetMapEvents.GetTeleportSaves()); Debug.Log(JsonUtility.ToJson(fullSave)); return(JsonUtility.ToJson(fullSave)); }
public void LoadData(string json) { FullSave fullSave = JsonUtility.FromJson <FullSave>(json); // Singleton static // Reference JsonUtility.FromJsonOverwrite(fullSave.PlayerPart.Who, Player); StartHomeStats.Load(fullSave.HomePart); dorm.Load(fullSave.DormPart); voreChar.Load(fullSave.VoreSaves, Player); // Pure static DateSystem.Load(fullSave.DatePart); QuestsSystem.Load(fullSave.QuestSave); PlayerFlags.Load(fullSave.PlayerFlagsSave); MapEvents.GetMapEvents.Load(fullSave.PosPart, fullSave.TeleportSaves); GameManager.Load(fullSave.GameManagerSave); EventLog.ClearLog(); LoadEvent?.Invoke(); }