コード例 #1
0
        private void ShowGalleryWithImages()
        {
            GUILayout.BeginVertical(GetGUISkin().scrollView);

            GUILayout.Box("Pick From Gallery");

            GUILayout.FlexibleSpace();

            m_scrollView.BeginScrollView();

            foreach (Texture _each in m_galleryImages)
            {
                if (GUILayout.Button(_each))
                {
                    PickImageFinished(GetAssetPath(_each));
                }
            }

            m_scrollView.EndScrollView();

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Cancel"))
            {
                PickImageCancelled();
            }

            GUILayout.EndVertical();
        }
コード例 #2
0
        protected override void OnGUIWindow()
        {
            base.OnGUIWindow();

            GUILayout.BeginVertical();
            {
                m_scrollView.BeginScrollView();
                {
                    DrawMessageSharing();
                    DrawMailSharing();
                    DrawWhatsAppSharing();
                    DrawSocialNetworkingSharing();
                    DrawGeneralSharing();
                }

                m_scrollView.EndScrollView();
            }
            GUILayout.EndVertical();

            GUILayout.FlexibleSpace();

            DrawResults();

            DrawPopButton();
        }
コード例 #3
0
ファイル: DemoSubMenu.cs プロジェクト: batiacosta/Cyramza
        protected void DrawResults()
        {
            GUILayout.FlexibleSpace();

            if (m_results.Count > 0)
            {
                m_resultsScrollView.BeginScrollView(UISkin.window, GUILayout.MinHeight(Screen.height * 0.3f));
                {
                    for (int _i = 0; _i < m_results.Count; _i++)
                    {
                        string _result = m_results[_i];

                        if (_i == 0)
                        {
                            GUILayout.Box(_result);
                        }
                        else
                        {
                            GUILayout.Label(_result);
                        }
                    }
                    GUILayout.FlexibleSpace();
                }
                m_resultsScrollView.EndScrollView();
            }
        }
コード例 #4
0
        protected override void OnGUIWindow()
        {
            base.OnGUIWindow();

            RootScrollView.BeginScrollView();
            {
                if (GUILayout.Button("Get Authorization Status"))
                {
                    AddNewResult("Authorization Status = " + GetAuthorizationStatus());
                }

                if (GUILayout.Button("Read Contacts"))
                {
                    AddNewResult("Started reading contacts in background. Please wait...");

                    // Read contact info
                    ReadContacts();
                }

                if (m_contactsInfo != null)
                {
                    m_eachColumnWidth = (GetWindowWidth() - GetWindowWidth() * 0.1f) / 5;
                    GUILayoutOption _entryWidthOption      = GUILayout.Width(m_eachColumnWidth);
                    GUILayoutOption _entryHeightOption     = GUILayout.Height(m_eachRowHeight);
                    GUILayoutOption _entryHalfHeightOption = GUILayout.Height(m_eachRowHeight / 2);

                    GUILayout.BeginHorizontal();
                    {
                        GUILayout.Box("Picture", kSubTitleStyle, _entryWidthOption, _entryHalfHeightOption);
                        GUILayout.Box("First Name", kSubTitleStyle, _entryWidthOption, _entryHalfHeightOption);
                        GUILayout.Box("Last Name", kSubTitleStyle, _entryWidthOption, _entryHalfHeightOption);
                        GUILayout.Box("Phone #'s", kSubTitleStyle, _entryWidthOption, _entryHalfHeightOption);
                        GUILayout.Box("Email ID's", kSubTitleStyle, _entryWidthOption, _entryHalfHeightOption);
                    }
                    GUILayout.EndHorizontal();

                    m_contactsScrollView.BeginScrollView();
                    {
                        for (int _i = 0; _i < m_contactsInfo.Length; _i++)
                        {
                            if (_i > m_maxContactsToRender)                             //This is just to limit drawing
                            {
                                break;
                            }

                            AddressBookContact _eachContact = m_contactsInfo[_i];
                            GUILayout.BeginHorizontal();
                            {
                                GUILayout.Label(m_contactPictures[_i], _entryWidthOption, _entryHeightOption);
                                GUILayout.Label(_eachContact.FirstName, _entryWidthOption, _entryHeightOption);
                                GUILayout.Label(_eachContact.LastName, _entryWidthOption, _entryHeightOption);

                                int _oldFontSize = UISkin.label.fontSize;
                                UISkin.label.fontSize = (int)(_oldFontSize * 0.5);

                                GUILayout.Label(_eachContact.PhoneNumberList.ToJSON(), _entryWidthOption, _entryHeightOption);
                                GUILayout.Label(_eachContact.EmailIDList.ToJSON(), _entryWidthOption, _entryHeightOption);

                                UISkin.label.fontSize = _oldFontSize;
                            }
                            GUILayout.EndHorizontal();
                        }
                    }
                    m_contactsScrollView.EndScrollView();
                }
            }
            RootScrollView.EndScrollView();

            DrawResults();
            DrawPopButton();
        }