Ejemplo n.º 1
0
    public IEnumerator Shot2()
    {
        isProcessing = true;
        yield return(new WaitForEndOfFrame());

        string myFileName           = "Screenshot" + System.DateTime.Now.Hour + System.DateTime.Now.Minute + System.DateTime.Now.Second + ".png";
        string myDefaultLocation    = Application.persistentDataPath + "/" + myFileName;
        string myFolderLocation     = "/storage/emulated/0/DCIM/ARCamera/";
        string myScreenshotLocation = myFolderLocation + myFileName;

        imageCurrentPath = myScreenshotLocation;

        if (!System.IO.Directory.Exists(myFolderLocation))
        {
            System.IO.Directory.CreateDirectory(myFolderLocation);
        }
        canvas2.SetActive(false);
        canvas1.transform.localScale = new Vector3(0, 0, 0);;

        yield return(new WaitForEndOfFrame());

        Texture2D ss = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);

        ss.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
        ss.Apply();

        // Save the screenshot to Gallery
        Debug.Log("Permission result: " + NativeGallery.SaveImageToGallery(ss, "ARCamera", myFileName));
        // To avoid memory leaks
        Destroy(ss);
        canvas1.transform.localScale = new Vector3(1f, 1f, 1f);
        isProcessing = false;

        AndroidContentOpenerWrapper.OpenContent(myScreenshotLocation);
    }
Ejemplo n.º 2
0
 public void OpenFile()
 {
     if (ScreenShot.imageCurrentPath != "A")
     {
         AndroidContentOpenerWrapper.OpenContent(ScreenShot.imageCurrentPath);
     }
     else
     {
         OpenG();
     }
 }
Ejemplo n.º 3
0
    public void openFolder()
    {
        string myFolderLocation = "/storage/emulated/0/ARCamera";

        AndroidContentOpenerWrapper.OpenContent(myFolderLocation);
    }
Ejemplo n.º 4
0
 void LoadContent(string path)
 {
     AndroidContentOpenerWrapper.OpenContent(path); //path must be path/to/file.filetype
 }