Class BaseEditor<T>
Small wrapper on top of Editor to ease the access of the underlying component
and its serialized fields.
Inheritance
BaseEditor<T>
Inherited Members
Editor.MoveNextTarget()
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
Declaration
protected T m_Target { get; }
Property Value
Methods
FindProperty<TValue>(Expression<Func<T, TValue>>)
Declaration
protected SerializedProperty FindProperty<TValue>(Expression<Func<T, TValue>> expr)
Parameters
Returns
Type Parameters