示例#1
0
    private IEnumerator _SaveVideoToGallery()
    {
        yield return(null);

#if UNITY_ANDROID && !UNITY_EDITOR
        System.DateTime now      = System.DateTime.Now;
        string          fileName = "Video_" + now.Year + "_" + now.Month + "_" + now.Day + "_" + now.Hour + "_" + now.Minute + "_" + now.Second + ".mp4";
        while (!System.IO.File.Exists(Application.persistentDataPath + "/" + VIDEO_NAME + ".mp4"))
        {
            yield return(null);
        }
        if (!System.IO.Directory.Exists(Application.persistentDataPath + GALLERY_PATH))
        {
            System.IO.Directory.CreateDirectory(Application.persistentDataPath + GALLERY_PATH);
        }
        System.IO.File.Copy(Application.persistentDataPath + "/" + VIDEO_NAME + ".mp4", Application.persistentDataPath + GALLERY_PATH + "/" + fileName);
        ShowToast("Video saved!");
        yield return(null);

        RefreshGallery(Application.persistentDataPath + GALLERY_PATH + "/" + fileName);
        AndroidUtils.OpenGallery();
#endif
    }
示例#2
0
 public void OnClickOpenGallery()
 {
     AndroidUtils.OpenGallery();
 }