27 lines
669 B
C#
27 lines
669 B
C#
using KitsuneCafe.Sys;
|
|
using UnityEditor;
|
|
using UnityEditor.UIElements;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace KitsuneCafe.Editor.PropertyDrawers
|
|
{
|
|
public class AccelerationField : VisualElement
|
|
{
|
|
public AccelerationField(string label)
|
|
{
|
|
var duration = new FloatField();
|
|
var curve = new CurveField();
|
|
Add(duration);
|
|
Add(curve);
|
|
}
|
|
}
|
|
|
|
[CustomPropertyDrawer(typeof(Acceleration))]
|
|
public class AccelerationPropertyDrawer : PropertyDrawer
|
|
{
|
|
public override VisualElement CreatePropertyGUI(SerializedProperty property)
|
|
{
|
|
return new AccelerationField(ObjectNames.NicifyVariableName(property.name));
|
|
}
|
|
}
|
|
}
|