Extending the editor

Hello today I just learned how to extend the editor and make better looking inspectors for my scripts. I’m making one for my charactermovement script and have hit a stump. In the CharacterMovement.cs there are AnimationClip’s. Everything else up to now has been EditorGUILayout.FLoatField, but what kind of thing would I use for an animationclip?

I’ve tried EditorGUILayout.ObjectFIeld - but could not get that to work. So how can I add my animation clips to my custom editor inspector?

I guess the question didn’t make sense.

I’m making an inspector window for my character controller and can’t figure out what to use for an animationclip. All my other values have been float fields and that was self explanatory. But what can I use to have my animationclips shown in the inspector window?

bump

tar.myAnimationClip = (AnimationClip)EditorGUILayout.ObjectField(tar.myAnimationClip, typeof(AnimationClip), true);

You could do something with a List of Strings instead since AnimationClips can be accessed by the string. animations[myListOfAnimations[indexLocation]].Play();

Thanks, didn’t think of casting the whole thing. :slight_smile: