obsidian/笔记文件/2.笔记/AnimationClip.SampleAnimation.md

21 lines
899 B
Markdown
Raw Permalink Normal View History

2025-03-26 00:02:56 +08:00
#unity/日常积累
# [AnimationClip](https://docs.unity.cn/cn/current/ScriptReference/AnimationClip.html).SampleAnimation
public void SampleAnimation ([GameObject](https://docs.unity.cn/cn/current/ScriptReference/GameObject.html) go, float time);
## 参数
go
动画游戏对象。
time
对动画进行采样的时间。
## 描述
在给定时间针对任何动画属性对动画进行采样。
出于性能原因,建议使用 [Animation](https://docs.unity.cn/cn/current/ScriptReference/Animation.html) 界面。 这将在给定的 `time` 对 `animation` 进行采样。 在该剪辑中的任何动画组件属性均将被替换成采样值。 大部分时间您想要使用 [Animation.Play](https://docs.unity.cn/cn/current/ScriptReference/Animation.Play.html)。当您想要按无序的方式或者 根据某些特殊输入进行跳帧时SampleAnimation 非常有用。