- Home /
Edit AnimationCurve from the inspector view? (Custom inspector)
I would like to edit an AnimationCurve property in the inspector view (rather than in a separate window), to make viewing and editing the curve more convenient. Something like seen in the AudioSource component:
I would only be editing a single curve, and I don't need the vertical line indicating the current point along the curve. EditorGUILayout.CurveField() did not give the expected result, and I can't find any other function for displaying the curves. I don't know how to approach this, so I hope someone can point me in the right direction.
Thanks in advance!
Hello, have you found a solution for this? this is exactly what I need too :)
Answer by MisterKidX · Sep 02, 2019 at 06:18 AM
Might be a little late, but for anyone googling this...
What you are looking for is the CurveEditor class. Unfortunately, it is internal to the Unity Editor and not exposed to user created editor scripts. You would have to implement one on your own :(
Thanks a lot for sharing this. I was looking for that information. Do you know if now (2022) there's any solution for this? Guess not. :(
@iuridosanjos glad you found it useful :) I don't know if there's a contemporary solution and I don't recall seeing one in the new UI Toolkit. You could try (and probably succeed) using reflection to utilize the CurveEditor class in editors.