internal void LoadFromJson(string path) { string json = System.IO.File.OpenText(path).ReadToEnd(); var gameData = JsonUtility.FromJson <SessionDataPackage>(json); Data = gameData; Data.InitAfterLoad(); }
// Use this for initialization void Start() { if (Data == null) { Data = new SessionDataPackage(); } if (ProfileName != "") { LoadFromJson("Saves/" + ProfileName + "/OnlySave.json"); } else { LoadFromJson("Assets/Data/InitSessionData.json"); } if (Data.PlayerName != ProfileName) { Data.PlayerName = ProfileName; } Data.Bureau.GenerateOperationStack(); }