更新弹窗
This commit is contained in:
1 parent
c19b8630cf
commit
44ff898f8d
13 files changed
+2468
-1400
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Mobile.Interface;
|
||||
using DG.Tweening;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -42,7 +43,53 @@ public class LoginControllerMobile : MonoBehaviour, INativeOnMobileWxLoginResp
|
||||
//App.weChatController.Init(App.WxAppId);
|
||||
//var s = App.weChatController.isApplicationAvilible("com.gugoumainapp","powerfun").ToString();
|
||||
//Utils.showToast(null, SystemInfo.batteryLevel.ToString());
|
||||
CheckUpdate();
|
||||
}
|
||||
|
||||
private async void CheckUpdate()
|
||||
{
|
||||
var r = await ConfigHelper.userApi.GetVersions();
|
||||
if (r.result)
|
||||
{
|
||||
|
||||
#if UNITY_ANDROID
|
||||
var info = r.data.Value<JObject>("UnityApk");
|
||||
Debug.Log(info.Value<string>("Version"));
|
||||
if (info.Value<string>("Version") != App.AppVersion)
|
||||
{
|
||||
transform.Find("Panel").gameObject.SetActive(false);
|
||||
transform.Find("Version").gameObject.SetActive(false);
|
||||
UIManager.ShowAndroidUpdate(info);
|
||||
}
|
||||
#elif UNITY_IOS
|
||||
var info = r.data.Value<JObject>("UnityIos");
|
||||
if (info.Value<string>("Version") != App.AppVersion)
|
||||
{
|
||||
Application.OpenURL(info.Value<string>("Url"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//if (r.result)
|
||||
//{
|
||||
// //#if !UNITY_EDITOR
|
||||
// var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
|
||||
// if (ver != null && ver.HasUpdate)
|
||||
// {
|
||||
// App.UpdateObject = ver;
|
||||
// Debug.Log(Application.persistentDataPath + "/PowerFun.exe");
|
||||
// UIManager.ShowDownloadModal();
|
||||
// }
|
||||
// //#endif
|
||||
// App.notifyContent = r.data.Value<string>("Content");
|
||||
|
||||
// if (r.data.Value<int>("Id") != notifyId)//r.data.Value<int>("Id") != notifyId
|
||||
// {
|
||||
// UIManager.ShowNewsModal();
|
||||
// PlayerPrefs.SetInt("notifyId", r.data.Value<int>("Id"));
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user