Files
BITFALL/Assets/Plugins/FImpossible Creations/Shared Tools/Editor/Property Drawers/FPD_FixedCurveWindowDrawer.cs
CortexCore ba342d6627 1
2023-11-30 00:23:23 +08:00

17 lines
625 B
C#

using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(FPD_FixedCurveWindowAttribute))]
public class FPD_FixedCurveWindow : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
FPD_FixedCurveWindowAttribute att = attribute as FPD_FixedCurveWindowAttribute;
if (property.propertyType == SerializedPropertyType.AnimationCurve)
{
EditorGUI.CurveField(position, property, att.Color, new Rect(att.StartTime, att.StartValue, att.EndTime - att.StartTime , att.EndValue - att.StartValue ), label );
}
}
}