UnityEditor.EditorGUILayout.GameViewSizePopup C# (CSharp) Method

GameViewSizePopup() static private method

static private GameViewSizePopup ( GameViewSizeGroupType groupType, int selectedIndex, IGameViewSizeMenuUser gameView, GUIStyle style ) : void
groupType GameViewSizeGroupType
selectedIndex int
gameView IGameViewSizeMenuUser
style UnityEngine.GUIStyle
return void
        internal static void GameViewSizePopup(GameViewSizeGroupType groupType, int selectedIndex, IGameViewSizeMenuUser gameView, GUIStyle style, params GUILayoutOption[] options)
        {
            s_LastRect = GetControlRect(false, 16f, style, options);
            EditorGUI.GameViewSizePopup(s_LastRect, groupType, selectedIndex, gameView, style);
        }

Usage Example

示例#1
0
        private void DoToolbarGUI()
        {
            ScriptableSingleton <GameViewSizes> .instance.RefreshStandaloneAndWebplayerDefaultSizes();

            if (ScriptableSingleton <GameViewSizes> .instance.GetChangeID() != this.m_SizeChangeID)
            {
                this.EnsureSelectedSizeAreValid();
                this.m_SizeChangeID = ScriptableSingleton <GameViewSizes> .instance.GetChangeID();
            }
            GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
            if (this.ShouldShowMultiDisplayOption())
            {
                GUILayoutOption[] optionArray1 = new GUILayoutOption[] { GUILayout.Width(80f) };
                int num = EditorGUILayout.Popup(this.m_TargetDisplay, DisplayUtility.GetDisplayNames(), EditorStyles.toolbarPopup, optionArray1);
                EditorGUILayout.Space();
                if (num != this.m_TargetDisplay)
                {
                    this.m_TargetDisplay = num;
                    this.GameViewAspectWasChanged();
                }
            }
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(160f) };
            EditorGUILayout.GameViewSizePopup(currentSizeGroupType, this.selectedSizeIndex, new Action <int, object>(this.SelectionCallback), EditorStyles.toolbarDropDown, options);
            if (FrameDebuggerUtility.IsLocalEnabled())
            {
                GUILayout.FlexibleSpace();
                Color color = GUI.color;
                GUI.color *= AnimationMode.animatedPropertyColor;
                GUILayout.Label("Frame Debugger on", EditorStyles.miniLabel, new GUILayoutOption[0]);
                GUI.color = color;
                if (Event.current.type == EventType.Repaint)
                {
                    FrameDebuggerWindow.RepaintAll();
                }
            }
            GUILayout.FlexibleSpace();
            if (RenderDoc.IsLoaded())
            {
                EditorGUI.BeginDisabledGroup(!RenderDoc.IsSupported());
                if (GUILayout.Button(this.renderdocContent, EditorStyles.toolbarButton, new GUILayoutOption[0]))
                {
                    base.m_Parent.CaptureRenderDoc();
                    GUIUtility.ExitGUI();
                }
                EditorGUI.EndDisabledGroup();
            }
            this.m_MaximizeOnPlay         = GUILayout.Toggle(this.m_MaximizeOnPlay, "Maximize on Play", EditorStyles.toolbarButton, new GUILayoutOption[0]);
            EditorUtility.audioMasterMute = GUILayout.Toggle(EditorUtility.audioMasterMute, "Mute audio", EditorStyles.toolbarButton, new GUILayoutOption[0]);
            this.m_Stats = GUILayout.Toggle(this.m_Stats, "Stats", EditorStyles.toolbarButton, new GUILayoutOption[0]);
            Rect position = GUILayoutUtility.GetRect(this.gizmosContent, s_GizmoButtonStyle);
            Rect rect2    = new Rect(position.xMax - s_GizmoButtonStyle.border.right, position.y, (float)s_GizmoButtonStyle.border.right, position.height);

            if (EditorGUI.ButtonMouseDown(rect2, GUIContent.none, FocusType.Passive, GUIStyle.none) && AnnotationWindow.ShowAtPosition(GUILayoutUtility.topLevel.GetLast(), true))
            {
                GUIUtility.ExitGUI();
            }
            this.m_Gizmos = GUI.Toggle(position, this.m_Gizmos, this.gizmosContent, s_GizmoButtonStyle);
            GUILayout.EndHorizontal();
        }
All Usage Examples Of UnityEditor.EditorGUILayout::GameViewSizePopup