UnityEditor.Editor.DrawHeader C# (CSharp) Method

DrawHeader() public method

Call this function to draw the header of the editor.

public DrawHeader ( ) : void
return void
        public void DrawHeader()
        {
            if (EditorGUIUtility.hierarchyMode)
            {
                this.DrawHeaderFromInsideHierarchy();
            }
            else
            {
                this.OnHeaderGUI();
            }
        }

Usage Example

コード例 #1
0
        // padding

        private void OnGUI()
        {
            // Try to create the editor object if it hasn't been initialized.
            if (editor == null)
            {
                editor = UnityEditor.Editor.CreateEditor(EM_Settings.Instance);
            }

            // If it's still null.
            if (editor == null)
            {
                EditorGUILayout.HelpBox("Coundn't create the settings resources editor.", MessageType.Error);
                return;
            }

            EM_SettingsEditor.callFromEditorWindow = true;
            EM_SettingsEditor.width  = position.width;
            EM_SettingsEditor.height = position.height;

            editor.DrawHeader();

            scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
            EditorGUILayout.BeginVertical(new GUIStyle()
            {
                padding = new RectOffset(left, right, top, bottom)
            });

            editor.OnInspectorGUI();

            EditorGUILayout.EndVertical();
            EditorGUILayout.EndScrollView();

            EM_SettingsEditor.callFromEditorWindow = false;
        }
All Usage Examples Of UnityEditor.Editor::DrawHeader