Created
February 10, 2018 02:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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