public static void Load() { if (File.Exists(Application.persistentDataPath + "/savedGames.gd")) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/savedGames.gd", FileMode.Open); m_saveData = (GameSaveData)bf.Deserialize(file); Debug.Assert(m_saveData != null); try { init(); m_tutMan.load(m_saveData.tutorialManagerData); //GameObject.FindGameObjectWithTag ("Tutorial").GetComponent<TutorialManager> ().eventDone(TutorialManager.EVENTS.EXIT); m_tm.load(m_saveData.TimeManagerData); m_phasem.load(m_saveData.PhaseManagerData); m_lm.load(m_saveData.LogicManagerData); m_bm.load(m_saveData.BuildingManagerData); m_cm.load(m_saveData.CoopManagerData); m_um.load(m_saveData.UserDataManagerData); m_im.load(m_saveData.InvestigationManagerData); m_pm.load(m_saveData.PenalizationManagerData); //tener en cuenta los callbacks de world terrain m_plaguem.load(m_saveData.PlagueManagerData); m_rm.load(m_saveData.RankingManagerData); m_rom.load(m_saveData.RiceObjectManagerData); m_workerm.load(m_saveData.WorkerManagerData); m_worldm.load(m_saveData.WorldTerrainData); m_worldm.canalManager.load(m_saveData.CanalManagerData); m_worldm.WeedFactory.load(m_saveData.WeedFactoryData); m_am.load(m_saveData.ActionManagerData); } catch (Exception ex) { Debug.LogError(ex.Message); Debug.LogError(ex.StackTrace); } file.Close(); } else { Debug.Log("ERROR Loading : file not found"); } }