由于这个插件提供的 AnimationController.cs仅对 Animation动画进行支持,对 Animator动画支持的话需要自己实现。文档上说明实现的方式:
- The WeaponTrail can be built by calling Itterate(float itterateTime) and UpdateTrail(float currentTime, float deltaTime). These functions are called by AnimationController, however if you don’t want to use AnimationController you can call these yourself.
即只需要调用 Itterate和 UpdateTrail方法。下面使用另外的角色模型进行测试拖尾效果。
测试角色的模型包:https://www.assetstore.unity3d.com/en/#!/content/15103
CSDN资源地址:http://download.csdn.net/detail/akof1314/7610385
首先,在Animator窗口,创建休闲idle状态和攻击attack状态,设置它们相应的Motion,设置从idle到attack的动画参数为Attack,类型为Trigger,如下图所示:
Speed属性可以控制当前状态动作的速度。接着,创建个脚本TestMyTrail.cs附加到角色上,脚本代码如下:
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
using UnityEngine;
using System.Collections; public class TestMyTrail : MonoB |