ソースコード
using UnityEngine;
public sealed class Curve01Attribute : PropertyAttribute
{
}
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer( typeof( Curve01Attribute ) )]
public sealed class Curve01Drawer : PropertyDrawer
{
public override void OnGUI
(
Rect position,
SerializedProperty property,
GUIContent label
)
{
if ( property.propertyType != SerializedPropertyType.AnimationCurve ) return;
var ranges = new Rect( 0, 0, 1, 1 );
EditorGUI.CurveField
(
position: position,
property: property,
color: Color.cyan,
ranges: ranges
);
}
}
参考サイト様