Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

Animation.CrossFadeQueued

マニュアルに切り替える
public AnimationState CrossFadeQueued(string animation, float fadeLength = 0.3F, QueueMode queue = QueueMode.CompleteOthers, PlayMode mode = PlayMode.StopSameLayer);
public AnimationState CrossFadeQueued(string animation, float fadeLength = 0.3F, QueueMode queue = QueueMode.CompleteOthers, PlayMode mode = PlayMode.StopSameLayer);
public AnimationState CrossFadeQueued(string animation, float fadeLength = 0.3F, QueueMode queue = QueueMode.CompleteOthers, PlayMode mode = PlayMode.StopSameLayer);
public AnimationState CrossFadeQueued(string animation, float fadeLength = 0.3F, QueueMode queue = QueueMode.CompleteOthers, PlayMode mode = PlayMode.StopSameLayer);

パラメーター

説明

前回のアニメーションが終了した際に、アニメーションをクロスフェードします。

例えばそれは、特定のアニメーションのシーケンスの役割を持つ再生かもしれません。

アニメーションは同じアニメーション間でフェードをするために再生前にアニメーションを複製します。 これは 2 つの同じアニメーションのオーバーレイに使用することができます。例えば剣を振るアニメーションがあったとします。 プレイヤーは素早く 2 回斬る動作をします。 アニメーションが巻き戻り最初から再生されますが、アニメーションはジャンプアニメーションを再生してしまう可能性があります。

The following queue modes are available:
If queue is QueueMode.CompleteOthers this animation will only start once all other animations have stopped playing.
queue が QueueMode.PlayNow の場合、このアニメーションはアニメーション状態を複製してすぐに再生を開始します。

アニメーションの再生が終了した後、アニメーションは自動的にクリーンアップされます。再生が終了した後に複製されたアニメーションのステートを使用すると例外が発生します。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Animation anim; void Start() { anim = GetComponent<Animation>(); } void Update() { if (Input.GetButtonDown("Fire1")) anim.CrossFadeQueued("shoot", 0.3F, QueueMode.PlayNow); } }