Ejemplo n.º 1
0
        private void ShowGameObjectInspector(EditorGameObjectData gameObjectData)
        {
            Inspector.Controls.Clear();

            var vertSpacing = 10;

            foreach (var componentData in gameObjectData.ComponentDatas)
            {
                var inspector = componentData.Inspector;
                inspector.ComponentData = componentData;
                inspector.Control       = Inspector;
                inspector.VertSpacing   = vertSpacing;
                inspector.OnGUI();

                vertSpacing += inspector.Height;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建TreeNode
        /// </summary>
        private TreeNode CreateTreeNode(EditorGameObjectData gameObjectData)
        {
            var treeNode = new TreeNode
            {
                Name = gameObjectData.ID.ToString(),
                Text = gameObjectData.Name,
            };

            if (gameObjectData.Children != null && gameObjectData.Children.Count > 0)
            {
                foreach (var child in gameObjectData.Children)
                {
                    treeNode.Nodes.Add(CreateTreeNode(child));
                }
            }

            return(treeNode);
        }