using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class CustomRoleController : MonoBehaviour { private Animator ani; private void Start() { ani = GetComponent(); var t1 = ani.GetBoneTransform(HumanBodyBones.LeftHand); var t2 = ani.GetBoneTransform(HumanBodyBones.LeftFoot); Debug.Log(t1.name + " " + t1.position); Debug.Log(t2.name + " " + t2.position); } public void UpdateBoneScale(EditableBodyPart part,float value) { CustomRoleUtility.UpdateBoneScale(ani, part, value); } public List GetBonesTrans() { var bonesTrans = new List(); //foreach (var item in Enum.GetValues(typeof(HumanBodyBones))) //{ // if(item == null) // { // continue; // } // var trans = ani.GetBoneTransform((HumanBodyBones)item); // if(trans) // { // bonesTrans.Add(trans); // } //} Debug.Log(Enum.GetValues(typeof(HumanBodyBones)).Length); for (int i = 0; i < Enum.GetValues(typeof(HumanBodyBones)).Length - 1; i++) { Debug.Log((HumanBodyBones)i + " " + i); var trans = ani.GetBoneTransform((HumanBodyBones)i); if (trans) { bonesTrans.Add(trans); } } return bonesTrans; } }