using System.Collections; using System.Collections.Generic; using UnityEngine; using SiegeSong; namespace SiegeSong { public static class SkinnedMeshExtension { public static void CopyBonesFrom(this Mesh target, Mesh source) { ////create a dictionary referencing source bones by name //Dictionary boneMap = new Dictionary(); //foreach (Transform bone in source.bones) //{ // boneMap[bone.name] = bone; //} ////match each bone name of the target to a bone from the source //for (int i = 0; i < target.bones.Length; ++i) //{ // string boneName = target.bones[i].name; // if (!boneMap.TryGetValue(boneName, out target.bones[i])) // { // Debug.LogError(target.name + " failed to get the bone, " + boneName + ", from " + source.name); // Debug.Break(); // } //} } } }