blob: e55144271109fe8ee8ac8087f38b009aca64977c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
namespace AdvancedInspector
{
public class AnimationCurveEditor : FieldEditor
{
public override Type[] EditedTypes
{
get { return new Type[] { typeof(AnimationCurve) }; }
}
public override void Draw(InspectorField field, GUIStyle style)
{
AnimationCurve curve = GetValue(field) as AnimationCurve;
if (curve == null && !field.Mixed)
curve = new AnimationCurve();
EditorGUI.BeginChangeCheck();
AnimationCurve result = EditorGUILayout.CurveField(curve);
if (EditorGUI.EndChangeCheck())
field.SetValue(result);
}
}
}
|