Пример #1
0
    public void LoadFromFile()
    {
        string json = System.IO.File.ReadAllText(persistentDataPath + settingFilePath);

        Debug.Log("load " + json);
        settingsDictionary = (DictionaryOfStringAndFloat)JsonUtility.FromJson <DictionaryOfStringAndFloat> (json);
        SetSliderValues(SceneManager.GetActiveScene().name);
    }
Пример #2
0
 void Start()
 {
     settingsDictionary = new DictionaryOfStringAndFloat();
     if (System.IO.File.Exists(persistentDataPath + settingFilePath))
     {
         LoadFromFile();
     }
     else
     {
         Debug.Log("could not find " + persistentDataPath + settingFilePath);
         WriteToFile();              // CopyInto ();
     }
     SceneManager.sceneLoaded   += OnSceneLoaded;
     SceneManager.sceneUnloaded += OnSceneUnloaded;
 }