|
@@ -7,6 +7,7 @@ using ET;
|
|
using FairyGUI;
|
|
using FairyGUI;
|
|
using UI.DressUp;
|
|
using UI.DressUp;
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
|
|
+using UnityEngine.Android;
|
|
|
|
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
@@ -64,9 +65,18 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnSave()
|
|
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;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|