예제 #1
0
        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);
        }
예제 #2
0
        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();
        }