private void onVideo(string path) { dispatch.Dispatch(() => { videoCallback(path); dispatch.Release(); dispatch = null; }); }
public static void SavePhoto(Texture2D photo, SaveMode mode = SaveMode.SaveToAppDocuments, Orientation orientation = 0, SaveCallback callback = null) { if (photo == null) { return; } if (orientation != 0) { IDispatch main = new MainDispatch(), worker = new ConcurrentDispatch(); Util.RotateImage(Texture2D.Instantiate(photo), orientation, worker, main, (rotated, unused) => { Implementation.SavePhoto(rotated.EncodeToPNG(), mode, callback); Texture2D.Destroy(rotated); main.Release(); worker.Release(); }); } else { Implementation.SavePhoto(photo.EncodeToPNG(), mode, callback); } }