Advertisement
santennio_ambiens

NativeGalleryForExplore.cs

Jan 27th, 2021
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using UnityEngine;
  6.  
  7. public class NativeGalleryForExplore : MonoBehaviour
  8. {
  9.     // Start is called before the first frame update
  10.     void Start()
  11.     {
  12.         PhotoCameraUI.OnStartTakingPhoto += this.onStartPhoto;
  13.         PhotoCameraUI.OnCompleteSavePhoto += this.onCompleteSavePhoto;
  14.         PhotoCameraUI.SaveOverride += this.SaveOverride;
  15.  
  16.     }
  17.  
  18.     private void SaveOverride(Texture2D txt, string name)
  19.     {
  20.         Debug.Log("Texturename " + name);
  21.        
  22.         var p=NativeGallery.SaveImageToGallery(txt, "Explore", name, (bool success, string finalPath) => {
  23.  
  24.             Debug.Log("SUCCESS? " + success);
  25.             Debug.Log(finalPath);
  26.         });
  27.         Debug.Log("permissions: " + p);
  28.     }
  29.     private void onCompleteSavePhoto(string path)
  30.     {
  31.         //DO SOMETHING HERE IF YOU WANT
  32.     }
  33.  
  34.     private void onStartPhoto()
  35.     {
  36.         //DO SOMETHING HERE IF YOU WANT
  37.     }
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement