I’m trying to add some functionality to the inspector when using AnimationCurves. I’m having trouble accessing the AnimationCurve itself so I can eventually modify it. I get the error that Unity.Object cannot be converted to AnimationCurve. I don’t get this error if my editor script targets one of my custom scripts, only if I target a unity class.
If I add buttons to this script, it applies them to every public AnimationCurve variable in my project, which is exactly what I want, but since I can’t actually access the animationcurve to make changes to it, its not doing me any good.
[CustomEditor(typeof(AnimationCurve))]
public class ExtendedCurves : Editor
{
private AnimationCurve thisCurve;
public void OnEnable()
{
thisCurve = (AnimationCurve)target;
}
}