Unity-Animator深入系列---目标匹配Target Matching
2016-01-03 10:58
731 查看
回到 Animator深入系列总目录
一开始会理所当然的觉得,匹配是这样的:
MatchTargetExample
使用方式:
1.TargetMatching只能工作在base layer
2.InterruptMatchTarget中的completeMatch设为True的话,会立即结束插值自动跳到目标匹配位置。
3.MatchTargetWeightMask是和原有动画之间的权重,如果为1就是完全控制。
4.isMatchingTarget字段确定当前是否在匹配状态
5.startNormalizedTime和targetNormalizedTime是相对于当前动画的匹配开始,结束时间。
一开始会理所当然的觉得,匹配是这样的:
using UnityEngine; public class MatchTargetExample : MonoBehaviour { public Animator animator; public GameObject testTarget; [ContextMenu("Start Match")] void StartMatch() { animator.MatchTarget(testTarget.transform.position, testTarget.transform.rotation, AvatarTarget.LeftHand, new MatchTargetWeightMask(Vector3.one, 1f), 0f); } [ContextMenu("Interrupt Match Target")] void InterruptMatchTarget() { animator.InterruptMatchTarget(); } }
MatchTargetExample
使用方式:
1.TargetMatching只能工作在base layer
2.InterruptMatchTarget中的completeMatch设为True的话,会立即结束插值自动跳到目标匹配位置。
3.MatchTargetWeightMask是和原有动画之间的权重,如果为1就是完全控制。
4.isMatchingTarget字段确定当前是否在匹配状态
5.startNormalizedTime和targetNormalizedTime是相对于当前动画的匹配开始,结束时间。
相关文章推荐
- 解决虚拟机的Unity模式无法进入及VM虚拟机安装vmware tools详细操作步骤(图)
- unity, asset operations
- 【u3d】环境搭建
- Unity-Animator深入系列---录制与回放
- 借助TinyXml,C++实现Unity的PlayerPrefs 功能
- unity与3DMax的单位问题
- Unity3D之坐标变化
- Unity3D之float Input.GetAxis(string axisname)
- Unity5脚本事件函数及其执行顺序
- Unity3D 经常使用库
- [转]How to translate WORLD coordinates to TERRAIN coordinates in Unity3d
- Unity-Animator深入系列---StateMachineBehaviour状态机脚本学习
- Unity+NGUI性能优化方法总结
- unity 2D总结(转发 忘记源地址了)
- unity4.6_摄像机跟随模式、观察模式融合(平滑)
- Unity3D教程:动画融合、动画层、动画混合、附加动画、程序动画、动画重放和取样
- Unity3D与Android,iOS交互
- 使用VS调试Unity脚本
- Unity 官方 Demo: 2DPlatformer 的 SLua 版本。
- unity中特殊文件夹