Skip to content

Instantly share code, notes, and snippets.

@prodigga
Created August 5, 2015 11:21
Show Gist options
  • Save prodigga/b5dc75e446cd34b5aaa1 to your computer and use it in GitHub Desktop.
Save prodigga/b5dc75e446cd34b5aaa1 to your computer and use it in GitHub Desktop.
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(ThreadsafeCurve))]
public class ThreadsafeCurvePropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
EditorGUI.PropertyField(position, property.FindPropertyRelative("_curve"), GUIContent.none);
EditorGUI.EndProperty();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment