我正在尝试获得骨骼的肌肉最大值,但我似乎无法访问它。我知道我想要哪个骨骼,但除了循环遍历所有骨骼的数组之外,我不知道如何访问它。
有没有办法只获取肌肉信息?这不起作用:
selected = Selection.activeGameObject.transform.root.gameObject;
Animator anim = selected.GetComponent<Animator>();
float indexMax = HumanTrait.GetMuscleDefaultMax(HumanBodyBones.LeftIndexProximal);这给了我一个对象的变换,但这不是我要找的:
Transform index1 = anim.GetBoneTransform(HumanBodyBones.LeftIndexProximal);如何才能在不遍历所有骨骼的情况下获得HumanTrait.GetMuscleDefaultMax?
发布于 2015-09-24 01:15:31
这个方法似乎做到了这一点( BoneInfo类需要用公共属性创建):
BoneInfo GetBoneInfo(HumanBodyBones id) {
int boneid = (int)id.GetHashCode();
BoneInfo info = new BoneInfo();
info.muscleMax = HumanTrait.GetMuscleDefaultMax(boneid);
info.muscleMin = HumanTrait.GetMuscleDefaultMin(boneid);
info.transform = anim.GetBoneTransform(id);
return info;
}https://stackoverflow.com/questions/32726158
复制相似问题