update: 还原 GuruSDKModel 缓存key 值, 确保老版本升级后数据不会丢失

main
胡宇飞 2024-08-09 10:02:26 +08:00
parent c001fe09ac
commit 49774c3281
1 changed files with 9 additions and 18 deletions

View File

@ -21,19 +21,10 @@ namespace Guru
{ {
//-------------- data --------------- //-------------- data ---------------
[JsonProperty(PropertyName = "uid")]
public string uid = ""; public string uid = "";
public int b_level = 0;
[JsonProperty(PropertyName = "b_level")] public int b_play = 0;
public int bLevel = 0; public bool no_ads = false;
[JsonProperty(PropertyName = "b_play")]
public int bPlay = 0;
[JsonProperty(PropertyName = "no_ads")]
public bool noAds = false;
[JsonProperty(PropertyName = "purchased")]
public List<PurchasedProduct> purchased = new List<PurchasedProduct>(10); public List<PurchasedProduct> purchased = new List<PurchasedProduct>(10);
//-------------- data --------------- //-------------- data ---------------
@ -67,9 +58,9 @@ namespace Guru
GuruSDKSerializedModel model = LoadModel(); GuruSDKSerializedModel model = LoadModel();
_uid = model.uid; _uid = model.uid;
_noAds = model.noAds; _noAds = model.no_ads;
_bLevel = new BindableProperty<int>(model.bLevel); _bLevel = new BindableProperty<int>(model.b_level);
_bPlay = new BindableProperty<int>(model.bPlay); _bPlay = new BindableProperty<int>(model.b_play);
_purchased = model.purchased; _purchased = model.purchased;
} }
@ -166,9 +157,9 @@ namespace Guru
var model = new GuruSDKSerializedModel() var model = new GuruSDKSerializedModel()
{ {
uid = _uid, uid = _uid,
bLevel = _bLevel.Value, b_level = _bLevel.Value,
bPlay = _bPlay.Value, b_play = _bPlay.Value,
noAds = _noAds, no_ads = _noAds,
purchased = _purchased, purchased = _purchased,
}; };