docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BaseEditor<T>

    Small wrapper on top of Editor to ease the access of the underlying component and its serialized fields.

    Inheritance
    object
    Object
    ScriptableObject
    Editor
    BaseEditor<T>
    Inherited Members
    Editor.CreateEditorWithContext(Object[], Object, Type)
    Editor.CreateEditorWithContext(Object[], Object)
    Editor.CreateCachedEditorWithContext(Object, Object, Type, ref Editor)
    Editor.CreateCachedEditorWithContext(Object[], Object, Type, ref Editor)
    Editor.CreateCachedEditor(Object, Type, ref Editor)
    Editor.CreateCachedEditor(Object[], Type, ref Editor)
    Editor.CreateEditor(Object)
    Editor.CreateEditor(Object, Type)
    Editor.CreateEditor(Object[])
    Editor.CreateEditor(Object[], Type)
    Editor.DrawPropertiesExcluding(SerializedObject, params string[])
    Editor.DrawDefaultInspector()
    Editor.Repaint()
    Editor.OnInspectorGUI()
    Editor.CreateInspectorGUI()
    Editor.RequiresConstantRepaint()
    Editor.DrawHeader()
    Editor.OnHeaderGUI()
    Editor.ShouldHideOpenButton()
    Editor.DrawFoldoutInspector(Object, ref Editor)
    Editor.HasPreviewGUI()
    Editor.GetPreviewTitle()
    Editor.RenderStaticPreview(string, Object[], int, int)
    Editor.OnPreviewGUI(Rect, GUIStyle)
    Editor.OnInteractivePreviewGUI(Rect, GUIStyle)
    Editor.OnPreviewSettings()
    Editor.GetInfoString()
    Editor.DrawPreview(Rect)
    Editor.ReloadPreviewInstances()
    Editor.UseDefaultMargins()
    Editor.Initialize(Object[])
    Editor.MoveNextTarget()
    Editor.ResetTarget()
    Editor.target
    Editor.targets
    Editor.serializedObject
    Editor.finishedDefaultHeaderGUI
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEditor.Rendering.PostProcessing
    Assembly: Unity.Postprocessing.Editor.dll
    Syntax
    public class BaseEditor<T> : Editor where T : MonoBehaviour
    Type Parameters
    Name Description
    T

    The type of the target component to make an editor for

    Examples
    public class MyMonoBehaviour : MonoBehaviour
    {
        public float myProperty = 1.0f;
    }
    
    [CustomEditor(typeof(MyMonoBehaviour))]
    public sealed class MyMonoBehaviourEditor : BaseEditor<MyMonoBehaviour>
    {
        SerializedProperty m_MyProperty;
    
        void OnEnable()
        {
            m_MyProperty = FindProperty(x => x.myProperty);
        }
    
        public override void OnInspectorGUI()
        {
            EditorGUILayout.PropertyField(m_MyProperty);
        }
    }

    Properties

    m_Target

    The target component.

    Declaration
    protected T m_Target { get; }
    Property Value
    Type Description
    T

    Methods

    FindProperty<TValue>(Expression<Func<T, TValue>>)

    Declaration
    protected SerializedProperty FindProperty<TValue>(Expression<Func<T, TValue>> expr)
    Parameters
    Type Name Description
    Expression<Func<T, TValue>> expr
    Returns
    Type Description
    SerializedProperty
    Type Parameters
    Name Description
    TValue
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)