public override void GalleryPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { base.GalleryPicture(filename, callback, maxSize); using (AndroidJavaObject unityPlayer = new AndroidJavaObject(GALLERY_PACKAGE + GALLERY_CLASS)) { unityPlayer.Call(GALLERY_METHOD_GALLERY_SELECT, gameObject.name, METHOD_PICTURE_CALLBACK, filename); } }
public override void CameraPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { base.CameraPicture(filename, callback, maxSize); using (AndroidJavaObject unityPlayer = new AndroidJavaObject(CAMERA_PACKAGE + CAMERA_CLASS)) { unityPlayer.Call(CAMERA_METHOD_TAKE_PICTURE, gameObject.name, filename, METHOD_PICTURE_CALLBACK); } }
public virtual void GalleryPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { #if UNITY_EDITOR || DEVELOPMENT_BUILD Debug.Log("Gallery Picture | " + "filename: " + filename + ", " + "maxSize: " + maxSize); #endif _callback = callback; _maxSize = maxSize; _count = MAX_COUNT; }
public override void GalleryPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { base.GalleryPicture(filename, callback, maxSize); string path = null; #if UNITY_EDITOR path = UnityEditor.EditorUtility.OpenFilePanel("Open image", "", "jpg,png,bmp"); #else // TODO: implement load file on standalone #endif PictureCallback(!string.IsNullOrEmpty(path), "file:///" + path); }
private void PictureLoaded(bool success, string path, Sprite sprite) { #if UNITY_EDITOR || DEVELOPMENT_BUILD Debug.Log("Picture Loaded | " + "success: " + success + ", " + "path: " + path + ", " + " sprite: " + sprite); #endif if (_callback != null) { _callback.Invoke(success, path, sprite); _callback = null; } else { #if UNITY_EDITOR || DEVELOPMENT_BUILD Debug.Log("Picture Callback is NULL"); #endif } }
public override void CameraPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { base.CameraPicture(filename, callback, maxSize); // TODO: implement webcam texture }
public override void GalleryPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { base.GalleryPicture(filename, callback, maxSize); Application.ExternalCall(WEB_SELECT_IMAGE, maxSize, gameObject.name, METHOD_PICTURE_CALLBACK); }
public override void CameraPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { base.CameraPicture(filename, callback, maxSize); Application.ExternalCall(WEB_ENABLE_CAMERA, false, maxSize, gameObject.name, METHOD_PICTURE_CALLBACK); }
public override void GalleryPicture(string filename, OnNewPictureHandler callback, int maxSize = -1) { base.GalleryPicture(filename, callback, maxSize); _SelectPicture(filename, METHOD_PICTURE_CALLBACK, gameObject.name); }