UnityEditor.Editor.OnInspectorGUI C# (CSharp) Method

OnInspectorGUI() public method

Implement this function to make a custom inspector.

public OnInspectorGUI ( ) : void
return void
        public virtual void OnInspectorGUI()
        {
            this.DrawDefaultInspector();
        }

Usage Example

示例#1
0
            public override void OnGUI(Rect rect)
            {
                rect.height = EditorGUIUtility.singleLineHeight;
                rect.y     += rect.height * 2;
                EditorGUI.BeginChangeCheck();

                switch (assignmentType.enumValueIndex)
                {
                case 0:                         // constant (we're not actually showing this right now)
                    _editor.OnInspectorGUI();
                    break;

                case 1:                         // global
                    EditorGUIUtility.labelWidth = 100;
                    _editor.OnInspectorGUI();

                    EditorGUIUtility.labelWidth = 0;
                    break;

                case 2:                         // instanced
                    if (_noReference)
                    {
                        GUILayout.Label("Not Intitialized / Lists not supported yet");
                    }
                    else
                    {
                        EditorGUIUtility.labelWidth = 100;
                        _editor.OnInspectorGUI();
                        EditorGUIUtility.labelWidth = 0;
                    }
                    break;
                }
            }
All Usage Examples Of UnityEditor.Editor::OnInspectorGUI