Esempio n. 1
0
        private BoneTreeElement BoneInfoToBoneTreeView(BoneInfo bone, ref int id)
        {
            var element = new BoneTreeElement {
                Id = ++id, Name = bone.boneTrans.name, Bone = bone
            };

            if (bone.childs != null && bone.childs.Count() > 0)
            {
                foreach (var child in bone.childs)
                {
                    var childElement = BoneInfoToBoneTreeView(child, ref id);
                    element.AddChild(childElement);
                }
            }

            return(element);
        }
Esempio n. 2
0
        private BoneTreeView CreateBoneTreeView(List <BoneInfo> rootBoneInfos, TreeViewState treeViewState)
        {
            var treeView  = new BoneTreeView(treeViewState);
            var currentId = 0;
            var root      = new BoneTreeElement {
                Id = ++currentId, Name = "Bones"
            };

            for (int i = 0; i < rootBoneInfos.Count(); i++)
            {
                root.AddChild(BoneInfoToBoneTreeView(rootBoneInfos[i], ref currentId));
            }
            treeView.Setup(new List <BoneTreeElement> {
                root
            }.ToArray());

            return(treeView);
        }