AnimationClip length always equal 1 when prefeb is loaded from assetbundle with Unity5.0.1

AssetBundle bundle = CTools.LoadBundleSync(“role001.ab”);
GameObject rolePfb = bundle.LoadAsset(“role001Pfb”) as GameObject;
Role = GameObject.Instantiate(rolePfb);
Animator animator = Role.GetComponent();
AnimationClip[ ] clips = animator.runtimeAnimatorController.animationClips;
for (int i = 0; i < clips.Length; i++)
{
Debug.Log(clips
.name + " len=" + clips*.length);*

}
print reslut is 1,but correct value is not 1
if I drag this prefeb to scene in editor mode,print it’s clip.length is correct.
why???

Animators are not always fully initialized until they exist in a scene, which may be why it’s giving you bad data. However, it should almost certainly either throw up a warning that the clip.length will be wrong, or return the correct clip length. I would suggest filing a bug report on this one.

Same question. I don’t think it’s a initialization issue. if use Resources.load to load the animation clip, it is correct.

It’s the Animator component itself that would be uninitialized. The AnimationClips are just data; there’s very little to initialize there.

I have a question in http://forum.unity3d.com/threads/animationclip-from-fbx-file-cant-be-loaded-from-assetbundle.382681/
Would you like to help?

Unity3D’s bug.