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
        }
    }
Beispiel #2
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);
    }
Beispiel #3
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);
        }
    }
Beispiel #4
0
 public void acessVideo()
 {
     AndroidPicker.BrowseVideo();
 }
Beispiel #5
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();
    }