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

スクリプト言語

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

HumanBone

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

Description

The mapping between a bone in the model and the conceptual bone in the Mecanim human anatomy.

The names of the Mecanim human bone and the bone in the model are stored along with the limiting muscle values that constrain the bone's rotation during animation.

function Start() {
	var boneName = new System.Collections.Generic.Dictionary.<String, String>();

	boneName["Chest"] = "Bip001 Spine2";
	boneName["Head"] = "Bip001 Head";
	boneName["Hips"] = "Bip001 Pelvis";
	boneName["LeftFoot"] = "Bip001 L Foot";
	boneName["LeftHand"] = "Bip001 L Hand";
	boneName["LeftLowerArm"] = "Bip001 L Forearm";
	boneName["LeftLowerLeg"] = "Bip001 L Calf";
	boneName["LeftShoulder"] = "Bip001 L Clavicle";
	boneName["LeftUpperArm"] = "Bip001 L UpperArm";
	boneName["LeftUpperLeg"] = "Bip001 L Thigh";
	boneName["RightFoot"] = "Bip001 R Foot";
	boneName["RightHand"] = "Bip001 R Hand";
	boneName["RightLowerArm"] = "Bip001 R Forearm";
	boneName["RightLowerLeg"] = "Bip001 R Calf";
	boneName["RightShoulder"] = "Bip001 R Clavicle";
	boneName["RightUpperArm"] = "Bip001 R UpperArm";
	boneName["RightUpperLeg"] = "Bip001 R Thigh";
	boneName["Spine"] = "Bip001 Spine1";

	var humanName: String[] = HumanTrait.BoneName;
	var humanBones: HumanBone[] = new HumanBone[boneName.Count];
	
	var j = 0;
	
	for (var i = 0; i < humanName.Length; i++) {
		if (boneName.ContainsKey(humanName[i])) {
			var humanBone = new HumanBone();
			humanBone.humanName = humanName[i];
			humanBone.boneName = boneName[humanName[i]];
            humanBone.limit.useDefaultValues = true;

			humanBones[j++] = humanBone;
		}
	}
}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Start() {
        stringstring boneName = new System.Collections.Generic.Dictionary<string, string>();
        boneName["Chest"] = "Bip001 Spine2";
        boneName["Head"] = "Bip001 Head";
        boneName["Hips"] = "Bip001 Pelvis";
        boneName["LeftFoot"] = "Bip001 L Foot";
        boneName["LeftHand"] = "Bip001 L Hand";
        boneName["LeftLowerArm"] = "Bip001 L Forearm";
        boneName["LeftLowerLeg"] = "Bip001 L Calf";
        boneName["LeftShoulder"] = "Bip001 L Clavicle";
        boneName["LeftUpperArm"] = "Bip001 L UpperArm";
        boneName["LeftUpperLeg"] = "Bip001 L Thigh";
        boneName["RightFoot"] = "Bip001 R Foot";
        boneName["RightHand"] = "Bip001 R Hand";
        boneName["RightLowerArm"] = "Bip001 R Forearm";
        boneName["RightLowerLeg"] = "Bip001 R Calf";
        boneName["RightShoulder"] = "Bip001 R Clavicle";
        boneName["RightUpperArm"] = "Bip001 R UpperArm";
        boneName["RightUpperLeg"] = "Bip001 R Thigh";
        boneName["Spine"] = "Bip001 Spine1";
        string[] humanName = HumanTrait.BoneName;
        HumanBone[] humanBones = new HumanBone[boneName.Count];
        int j = 0;
        int i = 0;
        while (i < humanName.Length) {
            if (boneName.ContainsKey(humanName[i])) {
                HumanBone humanBone = new HumanBone();
                humanBone.humanName = humanName[i];
                humanBone.boneName = boneName[humanName[i]];
                humanBone.limit.useDefaultValues = true;
                humanBones[j++] = humanBone;
            }
            i++;
        }
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Start() as void:
		boneName as System.Collections.Generic.Dictionary[of string, string] = System.Collections.Generic.Dictionary[of string, string]()
		boneName['Chest'] = 'Bip001 Spine2'
		boneName['Head'] = 'Bip001 Head'
		boneName['Hips'] = 'Bip001 Pelvis'
		boneName['LeftFoot'] = 'Bip001 L Foot'
		boneName['LeftHand'] = 'Bip001 L Hand'
		boneName['LeftLowerArm'] = 'Bip001 L Forearm'
		boneName['LeftLowerLeg'] = 'Bip001 L Calf'
		boneName['LeftShoulder'] = 'Bip001 L Clavicle'
		boneName['LeftUpperArm'] = 'Bip001 L UpperArm'
		boneName['LeftUpperLeg'] = 'Bip001 L Thigh'
		boneName['RightFoot'] = 'Bip001 R Foot'
		boneName['RightHand'] = 'Bip001 R Hand'
		boneName['RightLowerArm'] = 'Bip001 R Forearm'
		boneName['RightLowerLeg'] = 'Bip001 R Calf'
		boneName['RightShoulder'] = 'Bip001 R Clavicle'
		boneName['RightUpperArm'] = 'Bip001 R UpperArm'
		boneName['RightUpperLeg'] = 'Bip001 R Thigh'
		boneName['Spine'] = 'Bip001 Spine1'
		humanName as (string) = HumanTrait.BoneName
		humanBones as (HumanBone) = array[of HumanBone](boneName.Count)
		j as int = 0
		i as int = 0
		while i < humanName.Length:
			if boneName.ContainsKey(humanName[i]):
				humanBone as HumanBone = HumanBone()
				humanBone.humanName = humanName[i]
				humanBone.boneName = boneName[humanName[i]]
				humanBone.limit.useDefaultValues = true
				humanBones[(j++)] = humanBone
			i++

Variables

boneName メカニム のヒューマノイド型ボーンがマッピングされたボーン名
humanName モデルにおけるボーンのマッピング元となるメカニムのヒューマノイド型ボーン名
limit ボーンにおけるマッスルの可動域を返す