设备连接页面检测定位服务

This commit is contained in:
CaiYanPeng 2021-10-13 11:29:09 +08:00
parent efd1795e63
commit 9be2e77ae5
6 changed files with 14 additions and 3 deletions

View File

@ -66,6 +66,7 @@ public class LoginControllerMobile : MonoBehaviour, INativeOnMobileWxLoginResp
if (info.Value<string>("Version") != App.AppVersion) if (info.Value<string>("Version") != App.AppVersion)
{ {
Application.OpenURL(info.Value<string>("Url")); Application.OpenURL(info.Value<string>("Url"));
Application.Quit();
} }
#endif #endif
} }

View File

@ -546,7 +546,7 @@ public class LoginController : BaseScene
var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>(); var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
if (ver.UpdateLog.Count != notifyId) //ver.UpdateLog.Count != notifyId if (ver.UpdateLog.Count != notifyId) //ver.UpdateLog.Count != notifyId
{ {
var log = ver.UpdateLog.LastOrDefault(); var log = ver.UpdateLog.FirstOrDefault();
if (log != null) if (log != null)
{ {
App.notifyContent = log.Desc; App.notifyContent = log.Desc;

View File

@ -81,7 +81,6 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
// } // }
// SceneManager.LoadScene("Ride"); // SceneManager.LoadScene("Ride");
//}); //});
Debug.Log(84);
transform.GetComponent<Button>().onClick.RemoveAllListeners(); transform.GetComponent<Button>().onClick.RemoveAllListeners();
transform.GetComponent<Button>().onClick.AddListener(() => transform.GetComponent<Button>().onClick.AddListener(() =>
{ {

View File

@ -199,6 +199,10 @@ public class DeviceController : PFUIPanel
App.MainDeviceAdapter.ClearDevice(); App.MainDeviceAdapter.ClearDevice();
#if UNITY_ANDROID || UNITY_IOS #if UNITY_ANDROID || UNITY_IOS
App.MainDeviceAdapter.StartScan(); App.MainDeviceAdapter.StartScan();
#if !UNITY_EDITOR && UNITY_ANDROID
Utils.CallAndroidMethod("OpenLocationService");
#endif
#endif #endif
transform.MyDOFade(); transform.MyDOFade();
} }

View File

@ -191,6 +191,13 @@ namespace Assets.Scripts
loading.GetComponent<LoadingPf>().Show(); loading.GetComponent<LoadingPf>().Show();
} }
public static void CallAndroidMethod(string methodName,params object[] args)
{
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
var activity = jc.GetStatic<AndroidJavaObject>("currentActivity");
activity.Call(methodName, args);
}
public static void showLoadingExtension(this GameObject game) public static void showLoadingExtension(this GameObject game)
{ {
game.SetActive(true); game.SetActive(true);