UnityEditor.Editor.DrawHeaderGUI C# (CSharp) Method

DrawHeaderGUI() static private method

static private DrawHeaderGUI ( Editor editor, string header ) : Rect
editor Editor
header string
return UnityEngine.Rect
        internal static Rect DrawHeaderGUI(Editor editor, string header)
        {
            return DrawHeaderGUI(editor, header, 0f);
        }

Same methods

Editor::DrawHeaderGUI ( Editor editor, string header, float leftMargin ) : Rect

Usage Example

コード例 #1
0
        public static void DrawFoldoutInspector(UnityObject target, ref Editor editor)
        {
            if (editor != null && (editor.target != target || target == null))
            {
                UnityObject.DestroyImmediate(editor);
                editor = null;
            }

            if (editor == null && target != null)
                editor = Editor.CreateEditor(target);

            if (editor == null)
                return;

            const float kSpaceForFoldoutArrow = 10f;
            Rect titleRect = Editor.DrawHeaderGUI(editor, editor.targetTitle, kSpaceForFoldoutArrow);
            int id = GUIUtility.GetControlID(45678, FocusType.Passive);

            Rect renderRect = EditorGUI.GetInspectorTitleBarObjectFoldoutRenderRect(titleRect);
            renderRect.y = titleRect.yMax - 17f; // align with bottom
            bool oldVisible = UnityEditorInternal.InternalEditorUtility.GetIsInspectorExpanded(target);
            bool newVisible = EditorGUI.DoObjectFoldout(oldVisible, titleRect, renderRect, editor.targets, id);

            if (newVisible != oldVisible)
                UnityEditorInternal.InternalEditorUtility.SetIsInspectorExpanded(target, newVisible);

            if (newVisible)
                editor.OnInspectorGUI();
        }
All Usage Examples Of UnityEditor.Editor::DrawHeaderGUI