Inheritance: TreeViewDataSource
 private void InitTreeViewItem(GameObjectTreeViewItem item, int itemID, Scene scene, bool isSceneHeader, int colorCode, UnityEngine.Object pptrObject, bool hasChildren, int depth)
 {
     item.children = null;
     item.userData = null;
     item.id       = itemID;
     item.depth    = depth;
     item.parent   = null;
     if (isSceneHeader)
     {
         item.displayName = ((!string.IsNullOrEmpty(scene.name)) ? scene.name : "Untitled");
     }
     else
     {
         item.displayName = null;
     }
     item.colorCode     = colorCode;
     item.objectPPTR    = pptrObject;
     item.shouldDisplay = true;
     item.isSceneHeader = isSceneHeader;
     item.scene         = scene;
     item.icon          = ((!isSceneHeader) ? null : EditorGUIUtility.FindTexture("SceneAsset Icon"));
     if (hasChildren)
     {
         item.children = LazyTreeViewDataSource.CreateChildListForCollapsedParent();
     }
 }
Esempio n. 2
0
 private static void SetChildren(TreeViewItem item, List <TreeViewItem> newChildList)
 {
     if (LazyTreeViewDataSource.IsChildListForACollapsedParent(item.children) && newChildList == null)
     {
         return;
     }
     item.children = newChildList;
 }
        private GameObjectTreeViewItem CreateTreeViewItem(HierarchyProperty property, bool hasSearchString, int depth, bool shouldDisplay)
        {
            GameObjectTreeViewItem gameObjectTreeViewItem = new GameObjectTreeViewItem(property.instanceID, depth, null, string.Empty);

            gameObjectTreeViewItem.colorCode     = property.colorCode;
            gameObjectTreeViewItem.objectPPTR    = property.pptrValue;
            gameObjectTreeViewItem.shouldDisplay = shouldDisplay;
            if (!hasSearchString && property.hasChildren)
            {
                gameObjectTreeViewItem.children = LazyTreeViewDataSource.CreateChildListForCollapsedParent();
            }
            return(gameObjectTreeViewItem);
        }