public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { CurveAttribute curve = attribute as CurveAttribute; if (property.propertyType == SerializedPropertyType.AnimationCurve) { EditorGUI.CurveField(position, property, Color.green, new Rect(curve.PosX, curve.PosY, curve.RangeX, curve.RangeY)); } }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { CurveAttribute curve = attribute as CurveAttribute; if (property.propertyType == SerializedPropertyType.AnimationCurve) { Vector2 pos = Vector2.zero; Vector2 range = Vector2.one; /*foreach(Keyframe keyframe in property.animationCurveValue.keys) * { * if(keyframe.) * }*/ EditorGUI.CurveField(position, property, curve.color, new Rect(pos.x, pos.y, range.x, range.y)); } }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { CurveAttribute curve = attribute as CurveAttribute; switch (property.propertyType) { case SerializedPropertyType.AnimationCurve: { EditorGUI.CurveField(position, property, curve.color, curve.ranges, label); } break; default: { GUI.Label(position, "You can use Curve only on a AnimationCurve!"); } break; } }