-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Would you consider adding a custom property drawer for unity editor inspector?
Something like this works:
[CustomPropertyDrawer(typeof(fp))]
public class FpPropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var rawProperty = property.FindPropertyRelative("m_rawValue");
var fixedValue = fp.FromRaw(rawProperty.longValue);
var floatValue = EditorGUI.FloatField(position, label, (float)fixedValue);
fixedValue = (fp) floatValue;
rawProperty.longValue = fixedValue.RawValue;
}
}
Metadata
Metadata
Assignees
Labels
No labels