private TreeNode DumpTreeNode(SceneObject obj) { TreeNode node = null; DumpTreeNodeScript script = obj.GetScript <DumpTreeNodeScript>(); if (script != null) { node = script.DumpTreeNode(); } else { node = new TreeNode(string.Format("{0}", obj.Name)); node.Tag = obj; } // dump children nodes. foreach (var item in obj.Children) { TreeNode child = DumpTreeNode(item); if (child != null) { node.Nodes.Add(child); } } return(node); }
private TreeNode DumpTreeNode(SceneObject obj) { TreeNode node = null; DumpTreeNodeScript script = obj.GetScript <DumpTreeNodeScript>(); if (script != null) { node = script.DumpTreeNode(); } if (node != null) { foreach (var item in obj.Children) { TreeNode child = DumpTreeNode(item); if (child != null) { node.Nodes.Add(child); } } } return(node); }