using System.Collections.Generic; using UnityEngine; #if ! RENDER_SERVER #endif namespace Framework { public class Skeleton { private Dictionary _bones; private Transform _root; public Skeleton(Transform[] transforms, Transform root) { _root = root; if (transforms != null) { _bones = new Dictionary(transforms.Length); foreach (var t in transforms) { if (_bones.ContainsKey(t.name)) { DebugUtil.LogError("Skeleton 存在重复的骨骼名字 : {0}, root: {1}", t.name, _root.transform); continue; } _bones.Add(t.name, t); } } } public Transform GetBone(string name) { Transform bone = null; if (_bones != null && _bones.TryGetValue(name, out bone)) { } return bone; } } }