Пример #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
    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();
    }