修改细节

This commit is contained in:
CaiYanPeng 2021-10-13 19:03:14 +08:00
parent d8adb8a5b8
commit 3c540dece4
9 changed files with 1028 additions and 990 deletions

View File

@ -4,6 +4,7 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "WXApi.h" #import "WXApi.h"
//appid //appid
@ -109,3 +110,7 @@ bool checkAPPIsExist(const char * URLScheme)
return NO; return NO;
} }
} }
bool checkLocation()
{
return [CLLocationManager locationServicesEnabled] == YES;
}

File diff suppressed because it is too large Load Diff

View File

@ -100,7 +100,7 @@ public static class App
{ {
#if !UNITY_EDITOR #if !UNITY_EDITOR
//Host = "http://pf.juze.pro/"; //Host = "http://pf.juze.pro/";
////Host = "http://192.168.0.101:5085/"; //Host = "http://192.168.0.101:5083/";
//UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000); //UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
//TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001); //TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
Host = "https://wx.powerfun.com.cn/"; Host = "https://wx.powerfun.com.cn/";
@ -114,6 +114,6 @@ public static class App
App._IsRowerMode = bool.Parse(isRower); App._IsRowerMode = bool.Parse(isRower);
} }
Screen.sleepTimeout = SleepTimeout.NeverSleep; Screen.sleepTimeout = SleepTimeout.NeverSleep;
//Debug.Log(TimeSpan.FromSeconds(1).ToString(@"mm\:ss")); Debug.Log("117,"+ Utils.isUpdate("2.0.3","2.0.2"));
} }
} }

View File

@ -55,7 +55,7 @@ public class LoginControllerMobile : MonoBehaviour, INativeOnMobileWxLoginResp
#if UNITY_ANDROID #if UNITY_ANDROID
var info = r.data.Value<JObject>("UnityApk"); var info = r.data.Value<JObject>("UnityApk");
Debug.Log(info.Value<string>("Version")); Debug.Log(info.Value<string>("Version"));
if (info.Value<string>("Version") != App.AppVersion) if (Utils.isUpdate(App.AppVersion, info.Value<string>("Version")))
{ {
transform.Find("Panel").gameObject.SetActive(false); transform.Find("Panel").gameObject.SetActive(false);
transform.Find("Version").gameObject.SetActive(false); transform.Find("Version").gameObject.SetActive(false);
@ -63,7 +63,7 @@ public class LoginControllerMobile : MonoBehaviour, INativeOnMobileWxLoginResp
} }
#elif UNITY_IOS #elif UNITY_IOS
var info = r.data.Value<JObject>("UnityIos"); var info = r.data.Value<JObject>("UnityIos");
if (info.Value<string>("Version") != App.AppVersion) if (Utils.isUpdate(App.AppVersion, info.Value<string>("Version")))
{ {
Application.OpenURL(info.Value<string>("Url")); Application.OpenURL(info.Value<string>("Url"));
Application.Quit(); Application.Quit();

View File

@ -24,6 +24,9 @@ public class WeChatController
private static extern void WechatLogin(string scope,string state); private static extern void WechatLogin(string scope,string state);
[DllImport("__Internal")] [DllImport("__Internal")]
private static extern bool checkAPPIsExist(string URLScheme); private static extern bool checkAPPIsExist(string URLScheme);
[DllImport("__Internal")]
private static extern bool checkLocation();
#endif #endif
#endregion #endregion
/// <summary> /// <summary>
@ -175,6 +178,12 @@ public class WeChatController
#endif #endif
} }
#if UNITY_IOS
public bool CheckLocation()
{
return checkLocation();
}
#endif
public void SendMessageToUnity(string gameObjectName, string UnityMethodName) public void SendMessageToUnity(string gameObjectName, string UnityMethodName)
{ {
mainActivityClass.CallStatic("SendMessageToUnity",gameObjectName, UnityMethodName); mainActivityClass.CallStatic("SendMessageToUnity",gameObjectName, UnityMethodName);

View File

@ -540,11 +540,11 @@ public class LoginController : BaseScene
#elif UNITY_IOS #elif UNITY_IOS
var info = rr.data.Value<JObject>("UnityIos"); var info = rr.data.Value<JObject>("UnityIos");
#endif #endif
if (info.Value<string>("Version") != App.AppVersion) return; if (Utils.isUpdate(App.AppVersion,info.Value<string>("Version"))) return;
} }
Debug.Log(545); Debug.Log(notifyId);
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 + 1 != notifyId) //ver.UpdateLog.Count != notifyId
{ {
var log = ver.UpdateLog.FirstOrDefault(); var log = ver.UpdateLog.FirstOrDefault();
if (log != null) if (log != null)
@ -555,11 +555,12 @@ public class LoginController : BaseScene
{ {
App.notifyContent = r.data.Value<string>("Content"); App.notifyContent = r.data.Value<string>("Content");
} }
PlayerPrefs.SetInt("notifyId", ver.UpdateLog.Count); PlayerPrefs.SetInt("notifyId", ver.UpdateLog.Count + 1);
UIManager.ShowNewsModal(); UIManager.ShowNewsModal();
} }
#endif #endif
} }
GetRotateImage(); GetRotateImage();
} }
@ -1117,7 +1118,9 @@ public class LoginController : BaseScene
//wxLogin2.gameObject.SetActive(false); //wxLogin2.gameObject.SetActive(false);
signPage1.Find("next").gameObject.SetActive(false); signPage1.Find("next").gameObject.SetActive(false);
signPage1.Find("BtnModiPass").gameObject.SetActive(false); signPage1.Find("BtnModiPass").gameObject.SetActive(false);
#if !(UNITY_ANDROID || UNITY_IOS)
signPage1.Find("previousThird").gameObject.SetActive(true); signPage1.Find("previousThird").gameObject.SetActive(true);
#endif
signPage1.Find("signThird").gameObject.SetActive(true); signPage1.Find("signThird").gameObject.SetActive(true);
ShowPassword(); ShowPassword();
this.StartScrollPanel(3); this.StartScrollPanel(3);

View File

@ -199,8 +199,13 @@ 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 #if UNITY_ANDROID
Utils.CallAndroidMethod("OpenLocationService"); Utils.CallAndroidMethod("OpenLocationService");
#else
//if (!App.weChatController.CheckLocation())
//{
// Utils.showToast(null, "Please turn on location service");
//}
#endif #endif
#endif #endif

View File

@ -190,7 +190,23 @@ namespace Assets.Scripts
} }
loading.GetComponent<LoadingPf>().Show(); loading.GetComponent<LoadingPf>().Show();
} }
public static bool isUpdate(string currentVersion,string realVersion)
{
var a = currentVersion.Split('.');
var b = realVersion.Split('.');
if (a.Length != 3 || b.Length != 3) return false;
for (int i = 0; i < 3; i++)
{
var f1 = int.TryParse(a[i], out int ai);
var f2 = int.TryParse(b[i], out int bi);
if (!f1 || !f2) return false;
if (ai < bi)
{
return true;
}
}
return false;
}
public static void CallAndroidMethod(string methodName,params object[] args) public static void CallAndroidMethod(string methodName,params object[] args)
{ {
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");

View File

@ -133,7 +133,7 @@ PlayerSettings:
16:10: 1 16:10: 1
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 2.0.1 bundleVersion: 2.0.2
preloadedAssets: [] preloadedAssets: []
metroInputSource: 0 metroInputSource: 0
wsaTransparentSwapchain: 0 wsaTransparentSwapchain: 0
@ -179,7 +179,7 @@ PlayerSettings:
applicationIdentifier: applicationIdentifier:
Android: com.ZhiXingPai.PowerFunUnity Android: com.ZhiXingPai.PowerFunUnity
buildNumber: buildNumber:
iPhone: 2.0.1.12 iPhone: 2.0.2.2
AndroidBundleVersionCode: 1 AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 24 AndroidMinSdkVersion: 24
AndroidTargetSdkVersion: 0 AndroidTargetSdkVersion: 0