ios选择图片功能,结果列表扩大
This commit is contained in:
1 parent
510cd11049
commit
fe65b83c89
12 files changed
+295
-31
No files matched your search
@@ -6,16 +6,23 @@ using UnityEngine;
|
||||
public class ImageSelectorController
|
||||
{
|
||||
private AndroidJavaObject mainActivityObject = null;
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
private static extern void IOS_OpenCamera();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void IOS_OpenAlbum();
|
||||
#endif
|
||||
private static ImageSelectorController _instance;
|
||||
public static ImageSelectorController Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new ImageSelectorController();
|
||||
}
|
||||
#endif
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
@@ -30,6 +37,10 @@ public class ImageSelectorController
|
||||
}
|
||||
public void Select()
|
||||
{
|
||||
#if UNITY_IOS
|
||||
IOS_OpenAlbum();
|
||||
#else
|
||||
mainActivityObject.Call("Select");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user