Unity中有两种Animation Clip

http://blog.csdn.net/zzxiang1985/article/details/51291861

在Unity中,我们有两种方法创建Animation Clip。

一种(后面简称方法一)是选中挂载了Animation组件的GameObject,在Animation窗口中点击Create New Clip创建出来的Animation Clip。

另一种(后面简称方法二)是在Project窗口的空白地方右键单击,选择Create->Animation创建出来的Animation Clip。

这两种方法创建出来的都是.anim文件,但是在使用上却有点不一样。

选中方法一创建的.anim文件,Inspector窗口只有一个Wrap Mode选项。

而方法二创建的.anim文件的Inspector却比较复杂。

如果将Inspector切换为Debug模式,

可以看到方法一的.anim文件的Animation Type是1,

而方法二的.anim文件的Animation Type是2。

两种.anim文件都可以拖拽进GameObject身上挂载的Animation组件中,

也都可以在Animation窗口中编辑。

但是如果将方法二的.anim文件拖拽进Animation组件,并作为组件的默认Clip的话,那么游戏运行的时候这个Clip其实是播不出来的,而且Console会报一条“The AnimationClip 'XXX' used by the Animation component 'XXX' must be marked as Legacy.”的警告信息,以及一条“Default clip could not be found in attached animations list”的提示信息。也就是说方法二的.anim文件其实似乎不能直接用在Animation组件中。

但是方法二的.anim文件却可以拖拽进Animator窗口,作为Animator Controller的一个状态(需要先创建一个Animator Controller),当GameObject身上挂载着Animator,并且Animator引用了这个Animator Controller的时候,这个动画是可以正常播出的。

而方法一的.anim文件却无法拖拽进Animator的窗口。也就是说方法一的.anim文件似乎不能用在Animator中。

原文地址:https://www.cnblogs.com/alps/p/5924178.html