예제 #1
0
    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
        }
    }
예제 #2
0
 public void SelectPicture()
 {
             #if UNITY_ANDROID
     AndroidPicker.BrowseImage(true);
             #elif UNITY_IPHONE
     IOSPicker.BrowseImage(true);         // true for pick and crop
             #endif
 }
예제 #3
0
 // Update is called once per frame
 public void BrowseImage()
 {
     #if UNITY_ANDROID
     Debug.Log("browse");
     AndroidPicker.BrowseImage();
     Debug.Log("Android Images");
     #endif
 }
 public void getGalery()
 {
             #if UNITY_ANDROID
     AndroidPicker.BrowseImage(false);
     popup.SetActive(true);
             #elif UNITY_IPHONE
     IOSPicker.BrowseImage(false);         // pick
             #endif
 }
예제 #5
0
 public void test()
 {
     #if UNITY_ANDROID
     AndroidPicker.BrowseImage();
     #elif UNITY_IPHONE
     IOSPicker.BrowseImage();
     #else
     OnImageLoad("", Resources.Load("scar") as Texture2D);
     #endif
 }
예제 #6
0
    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
    }
예제 #7
0
    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
    }
예제 #8
0
    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);
    }
예제 #9
0
 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
 }
예제 #10
0
    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);
        }
    }
예제 #11
0
 public void acessImage()
 {
     AndroidPicker.BrowseImage();
 }
예제 #12
0
    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();
    }