Skip to content

Instantly share code, notes, and snippets.

@lynxelia
Created February 10, 2018 02:54
Show Gist options
  • Save lynxelia/701271b9a53b84d14d9a6c8e17e87f76 to your computer and use it in GitHub Desktop.
Save lynxelia/701271b9a53b84d14d9a6c8e17e87f76 to your computer and use it in GitHub Desktop.
An example of a custom editor class that utilizes DrawProperty to override the look of a property field
[CanEditMultipleObjects, CustomEditor(typeof(MyCustomClass), true)]
public class MyCustomEditor : BaseMonoBehaviourEditor
{
protected override void DrawProperty(Rect position, SerializedProperty property, GUIContent label)
{
if (property.name == "m_CanMove")
{
// insert custom editor code for this property
}
else
{
base.DrawProperty(property, label);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment