お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
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アニメーションするべきTransformを追加します。これにより作成するアニメーションの数を減らすことが出来ます。
例えば手を振るアニメーションがあったとします。
待機状態のキャラで手を振ったり、歩いている状態で手を振ったりしたい場合があるかもしれません。
待機のための手を振るアニメーションと歩く時のための手を振るアニメーションの2つのアニメーションを作成する必要はありません。
手を振るアニメーションをミックスして使用することにより肩の完全な制御を行います。ここで下半身はそれにより影響を受けることはありません。そして待機または歩きのアニメーションを再度再生させることもありません。
従って手を振るアニメーションのみを用意すれば問題ありません。
もし recursive
がtrueの場合は mix
のTransformのすべての子もアニメーションされます。
AddMixingTransformを呼び出さない場合は全てのアニメーションカーブが使用されます。
function Start() { var shoulder : Transform; animation["wave_hand"].AddMixingTransform(shoulder); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Start() { Transform shoulder; animation["wave_hand"].AddMixingTransform(shoulder); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Start() as void: shoulder as Transform animation['wave_hand'].AddMixingTransform(shoulder)
パスを使用する他の例:
function Start () { // Adds a mixing transform using a path instead var mixTransform : Transform = transform.Find("root/upper_body/left_shoulder"); animation["wave_hand"].AddMixingTransform(mixTransform); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Start() { Transform mixTransform = transform.Find("root/upper_body/left_shoulder"); animation["wave_hand"].AddMixingTransform(mixTransform); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Start() as void: mixTransform as Transform = transform.Find('root/upper_body/left_shoulder') animation['wave_hand'].AddMixingTransform(mixTransform)