- Home /
Animation field in custom inspector.
So, im trying to make a custom editor for my weapon script. Now my problem is i don't know how i can display an animation field in a custom inspector. I spent some time trying to find out how it works, but i didnt find a solution.
Answer by DoTA_KAMIKADzE · Apr 08, 2015 at 05:00 PM
If I understood you right you already know how to create custom inspector and get/save values to your target script so I'll just show the code with Animation field:
yourScriptReference.yourAnimationNameInScript = EditorGUILayout.ObjectField(yourScriptReference.yourAnimationNameInScript, typeof(Animation), false) as Animation;
Thank's exactly what i was looking for. :)
EDIT: I needed the AnimationClip one thx anyways
Your answer
Follow this Question
Related Questions
How should I serialize data that is also editable in the Inspector? 2 Answers
How to change inspector with non-Monobehaviour objects ? 1 Answer
Custom inspector for specific variable type to be reused? 2 Answers
What should be handled in the custom inspector version of a script? 1 Answer
Expand Component on Inspector 0 Answers