使用AnimationController(AnimationGraph)播放动画

最終更新: 2023年3月14日

本页说明在Cubism模型中使用Cocos Creator的AnimationController(AnimationGraph)的步骤。

此次的示例不会进行复杂的设置,而将会设置为重复两个动画。

概述

1. 从Asset视图中的Create asset context menu创建Animation Graph。
2. 打开Animation Graph。(双击或选中时按下Inspector的Edit按钮)

3. 按右键单击Animation Graph视图中的适当位置,然后从菜单中执行Add State – Animation Clip并追加一个State。
4. 选择追加的State,设置在Inspector的Animation Clip Motion -> Clip中载入模型时生成的AnimationClip。(从选择按钮中选择,拖放等)
5. 将Transition设置为从Entry开始播放的State。
6. 按照(3)、(4)的方法追加继续使用的动画。
7. 设置Transition用于从各State进行转换。

8. 将创建的Animation Graph设置为Model的AnimationController。
9. 将CubismMotionApplier追加到Model中。

这样就完成了使用AnimationController播放动画的设置。

关于Animation Graph中的变量设置、Transition的转换条件设置等详情,请参考Cocos Creator Manual的Marionette Animation System

请问这篇文章对您有帮助吗?
关于本报道,敬请提出您的意见及要求。