private void XiangCe(GameObject obj) { #if UNITY_ANDROID AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity"); jo.Call("TakePhoto", 1, 200, 200, "personalcenter", "HeadImage"); #elif UNITY_IPHONE IOSAlbumCamera.iosOpenPhotoAlbums(true); #endif // AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); // AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity"); // jo.Call("TakePhoto", 1, 200, 200); }
/// <summary> /// 从相册_时刻获取图片 /// </summary> void GetPictureFromMoment() { Debug.Log("Unity 打开相册_时刻 --> "); IOSAlbumCamera.iosOpenPhotoAlbums(false); }
void onclick_album() { IOSAlbumCamera.iosOpenPhotoAlbums(true); }