48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
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;
|
|
}
|
|
|
|
}
|