Class BaseEditor<T>
Small wrapper on top of Editor to ease the access of the underlying component and its serialized fields.
Inherited Members
Namespace: UnityEditor .Rendering.PostProcessing
Assembly: solution.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
Name | Description |
---|---|
m_Target | The target component. |
Methods
Name | Description |
---|---|
Find |