示例#1
0
        private void SaveConfiguration()
        {
            var countryInfos = new CountryInfoList
            {
                CountryInfos = Countries.Values.ToList()
            };

            var fileContents = JsonProcessor.SerializeObject(countryInfos, indented: true);

            JsonFileHelper.SaveFileContents(_configurationFilePath, fileContents);
        }
示例#2
0
 public void Awake()
 {
     if (m_Instance == null)
     {
         m_Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(this);
     }
     //getting local jsonFile
     jsonstring      = JsonFileToString(path);
     countryInfoList = JsonUtility.FromJson <CountryInfoList>(jsonstring);
 }