public Vector3 GetBoneLocation(int index, ECgBoneSpaces space = ECgBoneSpaces.World) { if (index >= Bones.Count) { return(Vector3.zero); } return(space == ECgBoneSpaces.World ? Bones[index].position : Bones[index].localPosition); }
public Vector3 GetBoneLocation(string name, ECgBoneSpaces space = ECgBoneSpaces.World) { Transform bone; BoneNameMap.TryGetValue(name, out bone); if (bone != null) { return(space == ECgBoneSpaces.World ? bone.position : bone.localPosition); } return(Vector3.zero); }