案例 : Assets/Scripts/Example/9.Native/Album/AlbumOperate.unity

    image.png

    1. //打开相册
    2. NativeInterface.Instance.OpenAlbum(PhotoPathCallBack);
    3. //截屏
    4. NativeInterface.Instance.CaptureScreen(CaptureCamera[2],
    5. new Rect(0, 0, Screen.width, Screen.height));
    6. //保存图片到相册
    7. NativeInterface.Instance.SaveTextureToAlbum(filename, texture2D, SaveCallBack);
    8. //开始录音
    9. NativeInterface.Instance.StartRecordVedio( CaptureCamera ,true, audioSource,Screen.width,Screen.height,
    10. recordVedioCallBack: OnReplay,recordTime:recordTime);
    11. //结束录音
    12. NativeInterface.Instance.StopRecordVedio();
    13. //保存音频到相册
    14. NativeInterface.Instance.SaveVedioToAlbum(path, SaveVedioCallBakc);

    注意 :
    iOS不会返回截图路径,暂时无此需求
    使用请注意权限的获取

    参考 :
    将图片保存到系统相册中, PHPhotoLibrary的简单使用