private void Start() { #if UNITY_ANDROID AndroidPicker.CheckPermissions(); #endif PickerEventListener.onImageLoad += OnImageLoad; }
void OnGUI() { GUILayout.Label(log); if (GUI.Button(new Rect(Screen.width / 2 - 75, Screen.height / 2 - 100, 150, 35), "Browse Image")) { #if UNITY_ANDROID AndroidPicker.BrowseImage(); #elif UNITY_IPHONE IOSPicker.BrowseImage(); #endif } if (GUI.Button(new Rect(Screen.width / 2 - 75, Screen.height / 2 - 20, 150, 35), "Browse Video")) { #if UNITY_ANDROID AndroidPicker.BrowseVideo(); #elif UNITY_IPHONE IOSPicker.BrowseVideo(); #endif } if (GUI.Button(new Rect(Screen.width / 2 - 75, Screen.height / 2 + 60, 150, 35), "Browse Contact")) { #if UNITY_ANDROID AndroidPicker.BrowseContact(); #elif UNITY_IPHONE IOSPicker.BrowseContact(); #endif } }
// Start is called before the first frame update void Start() { #if UNITY_ANDROID Debug.Log("start"); AndroidPicker.CheckPermissions(); Debug.Log("Android Perm"); #endif }
// Update is called once per frame public void BrowseImage() { #if UNITY_ANDROID Debug.Log("browse"); AndroidPicker.BrowseImage(); Debug.Log("Android Images"); #endif }
public void SelectPicture() { #if UNITY_ANDROID AndroidPicker.BrowseImage(true); #elif UNITY_IPHONE IOSPicker.BrowseImage(true); // true for pick and crop #endif }
public void getGalery() { #if UNITY_ANDROID AndroidPicker.BrowseImage(false); popup.SetActive(true); #elif UNITY_IPHONE IOSPicker.BrowseImage(false); // pick #endif }
public void test() { #if UNITY_ANDROID AndroidPicker.BrowseImage(); #elif UNITY_IPHONE IOSPicker.BrowseImage(); #else OnImageLoad("", Resources.Load("scar") as Texture2D); #endif }
void BtnCameraOnClick(PointerEventData eventData, UI_Event ev) { // select photo or take a picture PickerEventListener.onImageLoad += OnImageLoad; #if UNITY_ANDROID AndroidPicker.BrowseImage(true, Consts.PIC_WIDTH, Consts.PIC_HIGHT); #endif #if UNITY_IPHONE AndroidPicker.BrowseImage(true); #endif }
void OnEnable() { PickerEventListener.onImageSelect += OnImageSelect; PickerEventListener.onImageLoad += OnImageLoad; PickerEventListener.onVideoSelect += OnVideoSelect; PickerEventListener.onError += OnError; PickerEventListener.onCancel += OnCancel; #if UNITY_ANDROID AndroidPicker.CheckPermissions(); #endif }
public void OnButtonPointerDown() { #if UNITY_EDITOR string path = UnityEditor.EditorUtility.OpenFilePanel("Open image", "", "jpg,png,bmp"); if (!System.String.IsNullOrEmpty(path)) { FileSelected("file:///" + path); } #else AndroidPicker.BrowseImage(true); #endif }
public override void Init() { base.Init(); mBtnBack.onClick = BtnBackOnClick; mBtnOk.onClick = BtnOkOnClick; mBtnCamera.onClick = BtnCameraOnClick; //UI_Event _ev = UI_Event.Get(mTextDesc); //_ev.onClick = BtnSelectDescOnClick; #if UNITY_ANDROID AndroidPicker.CheckPermissions(); #endif }
void OnGUI() { float y = Screen.height * 0.1f; float x = Screen.width * 0.05f; float width = Screen.width * 0.9f; float height = Screen.height * 0.1f; if (GUI.Button(new Rect(x, y, width, height), "Browse Image")) { #if UNITY_ANDROID AndroidPicker.BrowseImage(false); #elif UNITY_IPHONE IOSPicker.BrowseImage(false); // true for pick and crop #endif } y += height + 25; if (GUI.Button(new Rect(x, y, width, height), "Browse & Crop Image")) { #if UNITY_ANDROID AndroidPicker.BrowseImage(true); #elif UNITY_IPHONE IOSPicker.BrowseImage(true); // true for pick and crop #endif } y += height + 25; if (GUI.Button(new Rect(x, y, width, height), "Browse Video")) { #if UNITY_ANDROID AndroidPicker.BrowseVideo(); #elif UNITY_IPHONE IOSPicker.BrowseVideo(); #endif } if (texture != null) { y += height + 20; float texContainerW = Mathf.Min(Screen.width * 0.2f, Screen.height * 0.2f); GUI.DrawTexture(new Rect(x, y, texContainerW, texContainerW), texture, ScaleMode.ScaleToFit, true); y += texContainerW + 10; } else { y += height + 10; } GUI.Label(new Rect(20, y, Screen.width - 40, Screen.height - y), log); }
public void test() { #if UNITY_ANDROID AndroidPicker.BrowseImage(); #elif UNITY_IPHONE IOSPicker.BrowseImage(); #else if (FindObjectOfType <DelauneyApp>().LearningMode) { OnImageLoad("", Resources.Load("textures/OMO1") as Texture2D); } else { OnImageLoad("", Resources.Load("ManFace") as Texture2D); } #endif }
void OnGUI() { GUILayout.Label(log); if (GUI.Button(new Rect(10, 10, 120, 35), "Browse Image")) { #if UNITY_ANDROID AndroidPicker.BrowseImage(false); #elif UNITY_IPHONE IOSPicker.BrowseImage(false); // true for pick and crop #endif } if (GUI.Button(new Rect(140, 10, 150, 35), "Browse & Crop Image")) { #if UNITY_ANDROID AndroidPicker.BrowseImage(true); #elif UNITY_IPHONE IOSPicker.BrowseImage(true); // true for pick and crop #endif } if (GUI.Button(new Rect(300, 10, 120, 35), "Browse Video")) { #if UNITY_ANDROID AndroidPicker.BrowseVideo(); #elif UNITY_IPHONE IOSPicker.BrowseVideo(); #endif } if (texture != null) { //texture.GetRawTextureData (); GUI.DrawTexture(new Rect(20, 50, Screen.width - 40, Screen.height - 60), texture, ScaleMode.ScaleToFit, true); } }
public void acessVideo() { AndroidPicker.BrowseVideo(); }
public void acessImage() { AndroidPicker.BrowseImage(); }
void OnGUI() { GUILayout.Label(log); if (GUI.Button(new Rect(10, 10, 150, 35), "Browse Image")) { #if UNITY_ANDROID AndroidPicker.BrowseImage(false); #elif UNITY_IPHONE IOSPicker.BrowseImage(false); // pick #endif } if (GUI.Button(new Rect(180, 10, 150, 35), "Browse Video")) { #if UNITY_ANDROID AndroidPicker.BrowseVideo(); #elif UNITY_IPHONE IOSPicker.BrowseVideo(); #endif } if (GUI.Button(new Rect(350, 10, 150, 35), "Browse Contact")) { #if UNITY_ANDROID AndroidPicker.BrowseContact(); #elif UNITY_IPHONE IOSPicker.BrowseContact(); #endif } sp1 = GUI.BeginScrollView(new Rect(10, 50, Screen.width / 2 - 20, Screen.height - 20), sp1, new Rect(0, 0, Screen.width / 2 - 50, _names.Count * 30)); for (int i = 0; i < _names.Count; i++) { if (GUI.Button(new Rect(0, 5 * i, Screen.width / 2 - 25, 25), _names[i])) { _selectedName = _names[i]; } } GUI.EndScrollView(); if (texture != null) { GUI.DrawTexture(new Rect(20, 50, Screen.width - 40, Screen.height - 60), texture, ScaleMode.ScaleToFit, true); } if (string.IsNullOrEmpty(_selectedName)) { return; } List <string> phNos = _phoneNumbers [_selectedName]; List <string> phEmails = _emails[_selectedName]; sp2 = GUI.BeginScrollView(new Rect(Screen.width / 2 + 10, 50, Screen.width / 2 - 20, Screen.height - 20), sp2, new Rect(0, 0, Screen.width / 2 - 50, phNos.Count * 30)); int counter = 1; for (int j = 0; j < phNos.Count; j++) { GUI.Label(new Rect(0, 5 * counter, Screen.width / 2 - 25, 25), phNos[j]); counter++; } for (int k = 0; k < phEmails.Count; k++) { GUI.Label(new Rect(0, 5 * counter, Screen.width / 2 - 25, 25), phEmails[k]); counter++; } GUI.EndScrollView(); }