guodong 2 жил өмнө
parent
commit
94a6ed0bd5

+ 13 - 3
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographSaveView.cs

@@ -7,6 +7,7 @@ using ET;
 using FairyGUI;
 using UI.DressUp;
 using UnityEngine;
+using UnityEngine.Android;
 
 namespace GFGGame
 {
@@ -64,9 +65,18 @@ namespace GFGGame
 
         private void OnClickBtnSave()
         {
-            string fileName = "wsj" + TimeHelper.ServerNowSecs + ".jpg";
-            PhotographUtil.Instance.SavePicturoToLocal(bytes, fileName);
-            _ui.m_btnSave.touchable = false;
+            //检查用户是否已授予对需要授权的设备资源或信息的访问权。
+            if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageWrite))
+            {
+                //请求用户授权访问需要授权的设备资源或信息.
+                Permission.RequestUserPermission(Permission.ExternalStorageWrite);
+            }
+            if (Permission.HasUserAuthorizedPermission(Permission.ExternalStorageWrite))
+            {
+                string fileName = "wsj" + TimeHelper.ServerNowSecs + ".jpg";
+                PhotographUtil.Instance.SavePicturoToLocal(bytes, fileName);
+                _ui.m_btnSave.touchable = false;
+            }
 
         }
 

+ 1 - 1
GameClient/ProjectSettings/ProjectSettings.asset

@@ -180,7 +180,7 @@ PlayerSettings:
   iPhoneStrippingLevel: 0
   iPhoneScriptCallOptimization: 0
   ForceInternetPermission: 0
-  ForceSDCardPermission: 1
+  ForceSDCardPermission: 0
   CreateWallpaper: 0
   APKExpansionFiles: 0
   keepLoadedShadersAlive: 0