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

スクリプト言語

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

AnimationState.weight

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

public var weight: float;
public float weight;
public weight as float

Description

アニメーションのウェイト

これは1つのカーブのブレンドウェイトを計算したものです。 一番トップのレイヤーが全てのアニメーションを取得できるようにウェイトは分散されます。 もしすべてのウェイトが使用しれていない場合は次のレイヤーに配布されることになります。 いったん全てのウェイトはトップのレイヤーで使用され、 ウェイトがなくなった場合は下のレイヤーで利用できなくなります。 Unityは適切にウェイトを使用します。もし低いレイヤーが80%のウェイトが欲しく、既に50%を使い果たしていたということが意味することは、レイヤーは全てのウェイトを使い果たさないということです。 代わりにそれは50%の80%(つまり40%)を占めます。 例: 上半身は波、歩き、待機アニメーションの影響を受けます。 下半身は歩きと待機アニメーションのみ影響を受けます。

	weight  name   layer   lower   upper
	 20%    wave     2        0%      20% 
	 50%    walk      1        50%    40% 
	 100%   idle       0        50%    40%

- ブレンドウェイトはミックスのためにアニメーションごとに値を変更することが出来ます。 ミックスなしでも、時々にはカーブはきっちりと定義されません。それでもブレンドウェイトの合計が1になるようにしたいとします。 時間のウェイトの殆どはカーブ間に類似しています。

	// Set the blend weight of the walk animation to 0.5
	animation["Walk"].weight = 0.5;
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        animation["Walk"].weight = 0.5F;
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		animation['Walk'].weight = 0.5F