public void OnSave() { SimulatedWideDataManager m = FindObjectOfType <SimulatedWideDataManager>(); if (null != m) { string str = m.SaveToString(); if (Application.platform == RuntimePlatform.WebGLPlayer) { PlayerPrefs.SetString("save", str); Debug.Log("save : " + str); } else { System.IO.File.WriteAllText("savegame.txt", str); } } }
public void OnLoadClic() { GameObject obj = new GameObject("simulatedData"); DontDestroyOnLoad(obj); LocalDataManager.instance = obj.AddComponent <LocalDataManager>(); SimulatedWideDataManager sm = obj.AddComponent <SimulatedWideDataManager>(); string str = ""; if (Application.platform == RuntimePlatform.WebGLPlayer) { str = PlayerPrefs.GetString("save"); } else { str = System.IO.File.ReadAllText("savegame.txt"); } sm.LoadFromString(str); sm._loadTime = 0.1f; WideDataManager.wideDataManager = sm; WideDataManager.wideDataManager.localDataManager = LocalDataManager.instance; LocalDataManager.instance.SetLocalCharacterID(1); UnityEngine.SceneManagement.SceneManager.LoadScene("PlayScene"); }
public SimulatedPOIsManager(SimulatedWideDataManager manager, SimulatedWideDataManager.SerializeContainer container) { _manager = manager; _container = container; random = new System.Random(); }
public SimulatedMarketManager(SimulatedWideDataManager manager, SimulatedWideDataManager.SerializeContainer container) { _manager = manager; _container = container; }
public SimulatedShipManager(SimulatedWideDataManager manager, SimulatedWideDataManager.SerializeContainer container) { _manager = manager; _container = container; _nextChange = new Dictionary <int, int>(); }