コード例 #1
0
ファイル: PlaySceneView.cs プロジェクト: McMuzzle/OpenMerx
    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);
            }
        }
    }
コード例 #2
0
    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");
    }
コード例 #3
0
 public SimulatedPOIsManager(SimulatedWideDataManager manager, SimulatedWideDataManager.SerializeContainer container)
 {
     _manager   = manager;
     _container = container;
     random     = new System.Random();
 }
コード例 #4
0
 public SimulatedMarketManager(SimulatedWideDataManager manager, SimulatedWideDataManager.SerializeContainer container)
 {
     _manager   = manager;
     _container = container;
 }
コード例 #5
0
 public SimulatedShipManager(SimulatedWideDataManager manager, SimulatedWideDataManager.SerializeContainer container)
 {
     _manager    = manager;
     _container  = container;
     _nextChange = new Dictionary <int, int>();
 }