private void LoadData() { if (HasOldSave()) { LoadOldSave(); } if (HasSave()) { Currencies = JsonUtility.FromJson <CurrenciesData>(PlayerPrefs.GetString("Currensies")); } Player = JsonUtility.FromJson <PlayerData>(PlayerPrefs.GetString("Player")); UpdateView(); }
/// <summary> /// Fetch currencies data from BackpackTF /// </summary> /// <param name="uri"></param> /// <returns></returns> /// <exception cref="WebException"></exception> /// <exception cref="ArgumentNullException"></exception> /// <exception cref="NotSupportedException"></exception> public static CurrenciesData DownloadCurrencyData(string uri) { using (var client = new WebClient()) return(CurrenciesData.FromJson(client.DownloadString(uri))); }