言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Animation.PlayQueued

Suggest a change

Success!

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

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public function PlayQueued(animation: string, queue: QueueMode = QueueMode.CompleteOthers, mode: PlayMode = PlayMode.StopSameLayer): AnimationState;
public AnimationState PlayQueued(string animation, QueueMode queue = QueueMode.CompleteOthers, PlayMode mode = PlayMode.StopSameLayer);
public def PlayQueued(animation as string, queue as QueueMode = QueueMode.CompleteOthers, mode as PlayMode = PlayMode.StopSameLayer) as AnimationState

Description

前回のアニメーションが終了した後に、アニメーションを再生します。

例えばそれは、特定のアニメーションのシーケンスの役割を持つ再生かもしれません。 アニメーションは同じアニメーション間でフェードをするために再生前にアニメーションステートを複製します。 これは2つの同じアニメーションのオーバーレイに使用することが出来ます。例えば剣を振るアニメーションがあったとします。 プレイヤーは素早く2回斬る動作をします。 アニメーションが巻き戻り最初から再生されますが、アニメーションはジャンプアニメーションを再生してしまう可能性があります。 以下の queue modes が使用可能です。:
/queue/ がQueueMode.CompleteOthersの場合、このアニメーションは他のアニメーションの再生が停止してからのみ開始されます。
/queue/ がQueueMode.PlayNowの場合、このアニメーションはアニメーション状態を複製してすぐに再生を開始します。 アニメーションの再生が終了した後、アニメーションは自動的にクリーンアップされます。再生が終了した後に複製されたアニメーションのステートを使用すると例外が発生します。

	function Update () {
		if (Input.GetButtonDown("Fire1"))	
			animation.PlayQueued("shoot", QueueMode.PlayNow);
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Update() {
        if (Input.GetButtonDown("Fire1"))
            animation.PlayQueued("shoot", QueueMode.PlayNow);
        
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Update() as void:
		if Input.GetButtonDown('Fire1'):
			animation.PlayQueued('shoot', QueueMode.PlayNow)