Class BaseEditor<T>
Small wrapper on top of
Inheritance
System.Object
BaseEditor<T>
Namespace: UnityEditor.Rendering.PostProcessing
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<System.Func<T, TValue>> | expr |
Returns
Type | Description |
---|---|
SerializedProperty |
Type Parameters
Name | Description |
---|---|
TValue |