private void FindTransformsInHierarchy(UnityNodeBase node, Dictionary <string, Transform> mapping) { if (node.GetResourceType() == PCFResourceType.TRANSFORM) { Transform trans = node.GetTransform(); mapping.Add(node.GetName(), trans); } for (int i = 0; i < node.ChildNodes.Count; i++) { UnityNodeBase child = node.ChildNodes[i]; PCFResourceType type = child.GetResourceType(); //Optimize search by not going into subtress that do not contain bones. if (type == PCFResourceType.ROOT || type == PCFResourceType.OBJECT || type == PCFResourceType.TRANSFORM) { FindTransformsInHierarchy(child, mapping); } } }