Просмотр исходного кода

隐私权限申请前先询问

lvjincheng 3 лет назад
Родитель
Сommit
1268c4c7dd

+ 14 - 11
Assets/BowArrow/Scripts/Manager/LoginMgr/RegisterView.cs

@@ -204,17 +204,20 @@ public class RegisterView : MonoBehaviour
             // };
 
             //2022-12-6 gps获取地理位置
-            GPSTool.GetAddress((address) => {
-                if (address != null) {
-                    countryCode = address[0];
-                    stateCode = address[1];
-                    cityCode = address[2];
-                    GetInputField(registerInLocation).text = 
-                        countryCode + " " + 
-                        stateCode + " " + 
-                        cityCode;
-                }
-            });
+            System.Action eOnAgree = () => {
+                GPSTool.GetAddress((address) => {
+                    if (address != null) {
+                        countryCode = address[0];
+                        stateCode = address[1];
+                        cityCode = address[2];
+                        GetInputField(registerInLocation).text = 
+                            countryCode + " " + 
+                            stateCode + " " + 
+                            cityCode;
+                    }
+                });
+            };
+            if (!HomeView.ShowProminentBeforeConnectBLE(eOnAgree)) eOnAgree.Invoke();
         }
     #endregion
 }

+ 1 - 1
Assets/BowArrow/Scripts/Network/UserPlayer.cs

@@ -121,7 +121,7 @@ public class UserPlayer : JCEntity
                             }
                         });
                     };
-                    if (HomeView.ins && !HomeView.ins.ShowProminentBeforeConnectBLE(eOnAgree)) eOnAgree.Invoke();
+                    if (!HomeView.ShowProminentBeforeConnectBLE(eOnAgree)) eOnAgree.Invoke();
                 }
             });            
         } else {

+ 1 - 1
Assets/BowArrow/Scripts/View/DeviceView1.cs

@@ -20,7 +20,7 @@ public class DeviceView1 : MonoBehaviour, MenuBackInterface
         PersistenHandler.ins?.menuBackCtr.views.Add(this);
 
         btnConnectBow.GetComponent<Button>().onClick.AddListener(delegate() {
-            if (HomeView.ins.ShowProminentBeforeConnectBLE()) return;
+            if (HomeView.ShowProminentBeforeConnectBLE()) return;
             BluetoothAim.ins.DoConnect();
         });
 

+ 1 - 1
Assets/BowArrow/Scripts/View/HomeView.cs

@@ -73,7 +73,7 @@ public class HomeView : MonoBehaviour
         }
     }
 
-    public bool ShowProminentBeforeConnectBLE(Action onAgree = null)
+    public static bool ShowProminentBeforeConnectBLE(Action onAgree = null)
     {
         if (PlayerPrefs.GetInt("Location-Prominent", 0) == 0) {
             ModalView m = ModalView.Show();

+ 14 - 11
Assets/BowArrow/Scripts/View/MeView.cs

@@ -140,17 +140,20 @@ public class MeView : MonoBehaviour, MenuBackInterface
             // };
 
             //2022-12-6 gps获取地理位置
-            GPSTool.GetAddress((address) => {
-                if (address != null) {
-                    countryCode = address[0];
-                    stateCode = address[1];
-                    cityCode = address[2];
-                    GetInputField(inputs.transform.GetChild(6)).text = 
-                        countryCode + " " + 
-                        stateCode + " " + 
-                        cityCode;
-                }
-            });
+            System.Action eOnAgree = () => {
+                GPSTool.GetAddress((address) => {
+                    if (address != null) {
+                        countryCode = address[0];
+                        stateCode = address[1];
+                        cityCode = address[2];
+                        GetInputField(inputs.transform.GetChild(6)).text = 
+                            countryCode + " " + 
+                            stateCode + " " + 
+                            cityCode;
+                    }
+                });
+            };
+            if (!HomeView.ShowProminentBeforeConnectBLE(eOnAgree)) eOnAgree.Invoke();
         }
     #endregion