public void ReparentItems(TreeViewItemBase <BoneCache> newParent, List <TreeViewItem> draggedItems) { if ((m_Model.hasCharacter && m_Model.mode != SkinningMode.Character) || (!m_Model.hasCharacter && m_Model.mode == SkinningMode.Character)) { return; } using (m_Model.UndoScope(TextContent.setParentBone)) { for (int i = 0; i < draggedItems.Count; ++i) { var bone = ((TreeViewItemBase <BoneCache>)draggedItems[i]).customData; m_Model.SetBoneParent(newParent != null ? newParent.customData : null, bone); m_SkinningEvents.skeletonTopologyChanged.Invoke(bone.skeleton); } } }
public void ReparentItems(TreeViewItemBase <BoneCache> newParent, List <TreeViewItem> draggedItems, int insertAtIndex) { if ((m_Model.hasCharacter && m_Model.mode != SkinningMode.Character) || (!m_Model.hasCharacter && m_Model.mode == SkinningMode.Character)) { return; } var parent = newParent != null ? newParent.customData : null; using (m_Model.UndoScope(TextContent.setParentBone)) { for (var i = draggedItems.Count - 1; i >= 0; --i) { var bone = ((TreeViewItemBase <BoneCache>)draggedItems[i]).customData; m_Model.SetBoneParent(parent, bone, insertAtIndex); m_SkinningEvents.skeletonTopologyChanged.Invoke(bone.skeleton); } } }