Пример #1
0
        protected override IList <TreeViewItem> BuildRows(TreeViewItem root)
        {
            var rows = new List <TreeViewItem>();

            if (_data != null)
            {
                var sorted = GetSortedBundleInfos(_data.bundles);
                for (var i = 0; i < sorted.Count; i++)
                {
                    var bundle     = sorted[i];
                    var bundleName = string.IsNullOrEmpty(bundle.name) ? "(noname)" : bundle.name;
                    var bundleTV   = new BundleBuilderTreeViewBundle(bundle.id, 0, bundleName, bundle);
                    rows.Add(bundleTV);
                    if (IsExpanded(bundleTV.id))
                    {
                        AddChildrenRecursive(rows, bundle, bundleTV);
                    }
                    else
                    {
                        bundleTV.children = CreateChildListForCollapsedParent();
                    }
                }

                SetupParentsAndChildrenFromDepths(root, rows);
            }
            return(rows);
        }
Пример #2
0
 protected void AddChildrenRecursive(List <TreeViewItem> rows, BundleBuilderData.BundleInfo bundleInfo, BundleBuilderTreeViewBundle node)
 {
     foreach (var target in bundleInfo.targets)
     {
         var targetPath = target.targetPath ?? "";
         var name       = "(null)";
         if (targetPath.StartsWith("Assets/"))
         {
             var assetObject = AssetDatabase.LoadMainAssetAtPath(targetPath);
             if (assetObject != null)
             {
                 name = assetObject.name;
             }
         }
         else
         {
             name = targetPath;
         }
         var tv = new BundleBuilderTreeViewTarget(target.id, 1, name, target);
         rows.Add(tv);
         if (IsExpanded(tv.id))
         {
         }
         else
         {
             // tv.children = CreateChildListForCollapsedParent();
         }
     }
 }
Пример #3
0
 protected void AddChildrenRecursive(List <TreeViewItem> rows, BundleBuilderData.BundleInfo bundleInfo, BundleBuilderTreeViewBundle node)
 {
     foreach (var target in bundleInfo.targets)
     {
         string name = "(null)";
         if (target.target != null)
         {
             name = target.target.name;
         }
         var tv = new BundleBuilderTreeViewTarget(target.id, 1, name, target);
         rows.Add(tv);
         if (IsExpanded(tv.id))
         {
         }
         else
         {
             // tv.children = CreateChildListForCollapsedParent();
         }
     }
 }