更新弹窗

This commit is contained in:
Caiyanpeng committed 2021-10-12 20:07:13 +08:00
1 parent c19b8630cf
commit 44ff898f8d
13 files changed
+2468 -1400

No files matched your search

+28 -5
View File
@@ -509,11 +509,12 @@ public class LoginController : BaseScene
//Task.Run(async () =>
//{
//});
#if !(UNITY_ANDROID || UNITY_IOS)
//});
var r = await ConfigHelper.userApi.GetNotify();
if (r.result)
{
#if !(UNITY_ANDROID || UNITY_IOS)
//#if !UNITY_EDITOR
var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
if (ver != null && ver.HasUpdate)
@@ -530,10 +531,32 @@ public class LoginController : BaseScene
UIManager.ShowNewsModal();
PlayerPrefs.SetInt("notifyId", r.data.Value<int>("Id"));
}
}
#endif
GetRotateImage();
#else
var rr = await ConfigHelper.userApi.GetVersions();
if (rr.result)
{
var info = rr.data.Value<JObject>("UnityApk");
if (info.Value<string>("Url") != App.AppVersion) return;
}
var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
if (ver.UpdateLog.Count != notifyId) //ver.UpdateLog.Count != notifyId
{
var log = ver.UpdateLog.LastOrDefault();
if (log != null)
{
App.notifyContent = log.Desc;
}
else
{
App.notifyContent = r.data.Value<string>("Content");
}
PlayerPrefs.SetInt("notifyId", ver.UpdateLog.Count);
UIManager.ShowNewsModal();
}
#endif
}
GetRotateImage();
}
async void GetRotateImage()