Пример #1
0
        private void ShowUnityRemoteGUI(bool editorEnabled)
        {
            GUI.enabled = true;
            GUILayout.Label("Unity Remote", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUI.enabled = editorEnabled;
            int        indexById1 = EditorSettingsInspector.GetIndexById(this.remoteDeviceList, EditorSettings.unityRemoteDevice, 0);
            GUIContent content1   = new GUIContent(this.remoteDevicePopupList[indexById1].content);
            Rect       rect1      = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content1, EditorStyles.popup), 0, new GUIContent("Device"));

            if (EditorGUI.ButtonMouseDown(rect1, content1, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect1, this.remoteDevicePopupList, indexById1, new GenericMenu.MenuFunction2(this.SetUnityRemoteDevice));
            }
            int        indexById2 = EditorSettingsInspector.GetIndexById(this.remoteCompressionList, EditorSettings.unityRemoteCompression, 0);
            GUIContent content2   = new GUIContent(this.remoteCompressionList[indexById2].content);
            Rect       rect2      = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content2, EditorStyles.popup), 0, new GUIContent("Compression"));

            if (EditorGUI.ButtonMouseDown(rect2, content2, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect2, this.remoteCompressionList, indexById2, new GenericMenu.MenuFunction2(this.SetUnityRemoteCompression));
            }
            int        indexById3 = EditorSettingsInspector.GetIndexById(this.remoteResolutionList, EditorSettings.unityRemoteResolution, 0);
            GUIContent content3   = new GUIContent(this.remoteResolutionList[indexById3].content);
            Rect       rect3      = EditorGUI.PrefixLabel(GUILayoutUtility.GetRect(content3, EditorStyles.popup), 0, new GUIContent("Resolution"));

            if (!EditorGUI.ButtonMouseDown(rect3, content3, FocusType.Passive, EditorStyles.popup))
            {
                return;
            }
            this.DoPopup(rect3, this.remoteResolutionList, indexById3, new GenericMenu.MenuFunction2(this.SetUnityRemoteResolution));
        }
Пример #2
0
        private void ShowUnityRemoteGUI(bool editorEnabled)
        {
            GUI.enabled = true;
            GUILayout.Label("Unity Remote", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUI.enabled = editorEnabled;
            string     unityRemoteDevice = EditorSettings.unityRemoteDevice;
            int        indexById         = EditorSettingsInspector.GetIndexById(this.remoteDeviceList, unityRemoteDevice, 0);
            GUIContent content           = new GUIContent(this.remoteDevicePopupList[indexById].content);
            Rect       rect = GUILayoutUtility.GetRect(content, EditorStyles.popup);

            rect = EditorGUI.PrefixLabel(rect, 0, new GUIContent("Device"));
            if (EditorGUI.ButtonMouseDown(rect, content, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect, this.remoteDevicePopupList, indexById, new GenericMenu.MenuFunction2(this.SetUnityRemoteDevice));
            }
            int indexById2 = EditorSettingsInspector.GetIndexById(this.remoteCompressionList, EditorSettings.unityRemoteCompression, 0);

            content = new GUIContent(this.remoteCompressionList[indexById2].content);
            rect    = GUILayoutUtility.GetRect(content, EditorStyles.popup);
            rect    = EditorGUI.PrefixLabel(rect, 0, new GUIContent("Compression"));
            if (EditorGUI.ButtonMouseDown(rect, content, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect, this.remoteCompressionList, indexById2, new GenericMenu.MenuFunction2(this.SetUnityRemoteCompression));
            }
            int indexById3 = EditorSettingsInspector.GetIndexById(this.remoteResolutionList, EditorSettings.unityRemoteResolution, 0);

            content = new GUIContent(this.remoteResolutionList[indexById3].content);
            rect    = GUILayoutUtility.GetRect(content, EditorStyles.popup);
            rect    = EditorGUI.PrefixLabel(rect, 0, new GUIContent("Resolution"));
            if (EditorGUI.ButtonMouseDown(rect, content, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect, this.remoteResolutionList, indexById3, new GenericMenu.MenuFunction2(this.SetUnityRemoteResolution));
            }
            int indexById4 = EditorSettingsInspector.GetIndexById(this.remoteJoystickSourceList, EditorSettings.unityRemoteJoystickSource, 0);

            content = new GUIContent(this.remoteJoystickSourceList[indexById4].content);
            rect    = GUILayoutUtility.GetRect(content, EditorStyles.popup);
            rect    = EditorGUI.PrefixLabel(rect, 0, new GUIContent("Joystick Source"));
            if (EditorGUI.ButtonMouseDown(rect, content, FocusType.Passive, EditorStyles.popup))
            {
                this.DoPopup(rect, this.remoteJoystickSourceList, indexById4, new GenericMenu.MenuFunction2(this.SetUnityRemoteJoystickSource));
            }
        }