Created
March 8, 2014 13:07
-
-
Save baba-s/9430335 to your computer and use it in GitHub Desktop.
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
| using UnityEditor; | |
| using UnityEngine; | |
| [CustomPropertyDrawer(typeof(MyPropertyAttribute))] | |
| public class MyPropertyDrawer : PropertyDrawer | |
| { | |
| public override void OnGUI( | |
| Rect position, | |
| SerializedProperty property, | |
| GUIContent label) | |
| { | |
| var myPropertyAttribute = | |
| attribute as MyPropertyAttribute; | |
| property.stringValue = EditorGUI.TextField( | |
| position, | |
| myPropertyAttribute.Label, | |
| property.stringValue); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment