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

スクリプト言語

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

HumanTrait.RequiredBone

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 static function RequiredBone(i: int): bool;
public static bool RequiredBone(int i);
public static def RequiredBone(i as int) as bool

Parameters

i 対象となるボーンのインデックス

Description

メカニムで必須なヒューマノイド ボーンである場合は true を返します

ボーンのインデックス値の順番は BoneName 配列と同じです。

function Start() {
	var boneName: String[] = HumanTrait.BoneName;
	
	for (var i = 0; i < HumanTrait.BoneCount; i++) {
		if(HumanTrait.RequiredBone(i))
			Debug.Log(boneName[i]);
	}
}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Start() {
        string[] boneName = HumanTrait.BoneName;
        int i = 0;
        while (i < HumanTrait.BoneCount) {
            if (HumanTrait.RequiredBone(i))
                Debug.Log(boneName[i]);
            
            i++;
        }
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Start() as void:
		boneName as (string) = HumanTrait.BoneName
		i as int = 0
		while i < HumanTrait.BoneCount:
			if HumanTrait.RequiredBone(i):
				Debug.Log(boneName[i])
			i++