public void AddBone(BoneCache bone, bool worldPositionStays) { Debug.Assert(bone != null); Debug.Assert(!Contains(bone)); if (bone.parent == null) { bone.SetParent(this, worldPositionStays); } m_Bones.Add(bone); }
public void SetBoneParent(BoneCache newParent, BoneCache bone) { TransformCache parent = newParent; if (newParent == null) { parent = bone.skeleton; } skinningCache.RestoreBindPose(); bone.SetParent(parent, true); bone.SetDefaultPose(); }
public void SetBoneParent(BoneCache newParent, BoneCache bone, int insertAtIndex) { TransformCache parent = newParent; if (newParent == null) parent = bone.skeleton; skinningCache.RestoreBindPose(); bone.SetParent(parent, true); if (insertAtIndex == -1) insertAtIndex = parent.ChildCount; bone.siblingIndex = insertAtIndex; bone.SetDefaultPose(); }