up
This commit is contained in:
47
Assets/3rd/Scripts/MyGallery.cs
Normal file
47
Assets/3rd/Scripts/MyGallery.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Coolape;
|
||||
|
||||
public static class MyGallery
|
||||
{
|
||||
|
||||
public static NativeGallery.Permission getImage(object callback)
|
||||
{
|
||||
NativeGallery.Permission pm;
|
||||
pm = NativeGallery.CheckPermission();
|
||||
if (pm == NativeGallery.Permission.Granted)
|
||||
{
|
||||
NativeGallery.GetImageFromGallery((path) =>
|
||||
{
|
||||
Utl.doCallback(callback, path);
|
||||
});
|
||||
}
|
||||
return pm;
|
||||
}
|
||||
|
||||
public static NativeGallery.Permission getMultImages(object callback)
|
||||
{
|
||||
NativeGallery.Permission pm;
|
||||
pm = NativeGallery.CheckPermission();
|
||||
if (pm == NativeGallery.Permission.Granted)
|
||||
{
|
||||
NativeGallery.GetImagesFromGallery((pathList) =>
|
||||
{
|
||||
Utl.doCallback(callback, pathList);
|
||||
});
|
||||
}
|
||||
return pm;
|
||||
}
|
||||
|
||||
public static bool openSetting()
|
||||
{
|
||||
if (NativeGallery.CanOpenSettings())
|
||||
{
|
||||
NativeGallery.OpenSettings();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user