お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Closeアニメーションのプロパティに時間を与えてアニメーションのサンプリングを行います
これはパフォーマンス上の理由から代わりにAnimationインタフェースを使用することをお勧めします。
これは time
を与えて animation
をサンプリングします。
クリップでアニメーションされているコンポーネントプロパティはサンプリングされた値に置き換えられます。
殆どの場合は代わりに Animation.Play を使用するほうがいいかもしれません。SampleAnimationは順不同なフレーム間でジャンプしたい場合や
特殊な入力を行いたい場合によく使用されます。
See Also: Animation.
// Plays an animation clip backwards by sampling it every frame. var clip : AnimationClip; function Update() { gameObject.SampleAnimation(clip, clip.length - Time.time); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public AnimationClip clip; void Update() { gameObject.SampleAnimation(clip, clip.length - Time.time); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): public clip as AnimationClip def Update() as void: gameObject.SampleAnimation(clip, (clip.length - Time.time))