Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created March 8, 2014 13:07
Show Gist options
  • Select an option

  • Save baba-s/9430335 to your computer and use it in GitHub Desktop.

Select an option

Save baba-s/9430335 to your computer and use it in GitHub Desktop.
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