Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Animation.CrossFadeQueued 淡入淡出队列
# [Animation](Animation.html).CrossFadeQueued 淡入淡出队列 function *CrossFadeQueued* (*animation* : string, *fadeLength* : float = 0.3F, *queue* : [QueueMode](../Enumerations/QueueMode/QueueMode.html) = [QueueMode.CompleteOthers](../Enumerations/QueueMode/QueueMode.CompleteOthers.html), *mode* : [PlayMode](../Enumerations/PlayMode/PlayMode.html) = [PlayMode.StopSameLayer](../Enumerations/PlayMode/PlayMode.StopSameLayer.html)) : [AnimationState](../AnimationState/AnimationState.html) *Description* 描述 Cross fades an animation after previous animations has finished playing. 在前一个动画播放完成之后淡入淡出下一个动画。 For example you might play a specific sequeue of animations after each other. 例如你可以播放一个特定的动画序列。 The animation duplicates itself before playing thus you can fade between the same animation. This can be used to overlay two same animations. For example you might have a sword swing animation. The player slashes two times quickly after each other. You could rewind the animation and play from the beginning but then you will get a jump in the animation. 动画在播放前复制自身,因此你可以再相同的动画间渐变,这可用来重叠两个相 同的动画。例如你可能有一个挥剑的动画,玩家快速挥动了 2 次,你可以回放这个动画并从开始播放它,但会跳帧。 The following [queue modes](../Enumerations/QueueMode/QueueMode.html) are available: If queue is [QueueMode.CompleteOthers](../Enumerations/QueueMode/QueueMode.CompleteOthers.html) this animation will only start once all other animations have stopped playing. If queue is [QueueMode.PlayNow](../Enumerations/QueueMode/QueueMode.PlayNow.html) this animation will start playing immediately on a duplicated animation state. 下面是可用的 queue modes: 如果 queue 为 [QueueMode.CompleteOthers](../Enumerations/QueueMode/QueueMode.CompleteOthers.html) 这个动画只在所有其他动画都停止播放时才开始。 如果 queue 为 [QueueMode.PlayNow](../Enumerations/QueueMode/QueueMode.PlayNow.html) 这个动画将以一个复制的动画状态立即开始播放。 After the animation has finished playing it will automatically clean itself up. Using the duplicated animation state after it has finished will result in an exception. 动画播放完成后它将自动清除它自己。在它播放完成后使用赋值的动画将导致一个异常。 * [C#](#) * [JavaScript](#) ``` using UnityEngine; using System.Collections; public class example : MonoBehaviour { void Update() { if (Input.GetButtonDown("Fire1")) animation.CrossFadeQueued("shoot", 0.3F, QueueMode.PlayNow); } } ``` ``` function Update () { if (Input.GetButtonDown("Fire1")) animation.CrossFadeQueued("shoot", 0.3, QueueMode.PlayNow); } ```
da
2022年5月13日 22:06
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码