Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
GameObject.SampleAnimation 动画采样
# [GameObject](GameObject.html).SampleAnimation 动画采样 function *SampleAnimation* (*animation* : [AnimationClip](../AnimationClip/AnimationClip.html), *time* : float) : void *Description* 描述 Samples an animation at a given time for any animated properties. It is recommended to use the Animation interface instead for performance reasons. This will sample animation at the given time. Any component properties that are animated in the clip will be replaced with the sampled value. Most of the time you want to use [Animation.Play](../Animation/Animation.Play.html) instead. SampleAnimation is useful when you need to jump between frames in an unordered way or based on some special input. 参见: [Animation](../Animation/Animation.html) 为所有动画属性在某个给定时间为一个动画采样。 除非特殊情况,推荐使用 Animation 接口.这个函数会在给定的时间点采样动画。在动画剪辑时的任何组件属性将被采样值取代。大部分情况下,你会使用 Animation.Play 来替代。你想在某种无序的时候操作某些帧或者一些特别的输入的时候,你可以使用 SampleAnimation. * [C#](#) * [JavaScript](#) ``` using UnityEngine; using System.Collections; public class example : MonoBehaviour { public AnimationClip clip; void Update() { gameObject.SampleAnimation(clip, clip.length - Time.time); } } ``` ``` // 通过每一帧采样来倒播一个动画 var clip : AnimationClip; function Update() { gameObject.SampleAnimation(clip, clip.length - Time.time); } ```
da
2022年5月20日 22:59
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码