- Home /
Question by
JanusHuang · Jun 10, 2013 at 01:49 AM ·
mecanimanimator controllereditorguilayoutobjectfield
EditorGUILayout.ObjectField with Mecanim Animator
Hi, guys. I want to build a Editor Tool that have a ObjectFiled can only receive Mecanim Animator Controller. My code goes..
using AnimatorController = UnityEditorInternal.AnimatorController;
srcAnimator = (AnimatorController)EditorGUILayout.ObjectField( "Source Animator", srcAnimator, typeof(AnimatorController), false );
But i got this error
InvalidCastException: Cannot cast from source type to destination type.
How to solve this? Thank!
Comment