BuildExportPackageItemsList() private method

private BuildExportPackageItemsList ( string guids, bool dependencies ) : UnityEditor.ExportPackageItem[]
guids string
dependencies bool
return UnityEditor.ExportPackageItem[]
 internal static IEnumerable <ExportPackageItem> GetAssetItemsForExport(ICollection <string> guids, bool includeDependencies)
 {
     if (guids.Count == 0)
     {
         string[] collection = new string[0];
         guids = new HashSet <string>(AssetServer.CollectAllChildren(AssetServer.GetRootGUID(), collection));
     }
     ExportPackageItem[] itemArray = PackageUtility.BuildExportPackageItemsList(guids.ToArray <string>(), includeDependencies);
     if (includeDependencies)
     {
         if (< > f__am$cache0 == null)
         {
 internal static IEnumerable <ExportPackageItem> GetAssetItemsForExport(ICollection <string> guids, bool includeDependencies)
 {
     if (guids.Count == 0)
     {
         guids = (ICollection <string>) new HashSet <string>((IEnumerable <string>)AssetServer.CollectAllChildren(AssetServer.GetRootGUID(), new string[0]));
     }
     ExportPackageItem[] exportPackageItemArray = PackageUtility.BuildExportPackageItemsList(guids.ToArray <string>(), includeDependencies);
     if (includeDependencies && ((IEnumerable <ExportPackageItem>)exportPackageItemArray).Any <ExportPackageItem>((Func <ExportPackageItem, bool>)(asset => InternalEditorUtility.IsScriptOrAssembly(asset.assetPath))))
     {
         exportPackageItemArray = PackageUtility.BuildExportPackageItemsList(guids.Union <string>(InternalEditorUtility.GetAllScriptGUIDs()).ToArray <string>(), includeDependencies);
     }
     return((IEnumerable <ExportPackageItem>)((IEnumerable <ExportPackageItem>)exportPackageItemArray).Where <ExportPackageItem>((Func <ExportPackageItem, bool>)(val => val.assetPath != "Assets")).ToArray <ExportPackageItem>());
 }
Example #3
0
 internal static IEnumerable <ExportPackageItem> GetAssetItemsForExport(ICollection <string> guids, bool includeDependencies)
 {
     if (guids.Count == 0)
     {
         string[] collection = new string[0];
         guids = new HashSet <string>(AssetServer.CollectAllChildren(AssetServer.GetRootGUID(), collection));
     }
     ExportPackageItem[] source = PackageUtility.BuildExportPackageItemsList(guids.ToArray <string>(), includeDependencies);
     if (includeDependencies)
     {
         if (source.Any((ExportPackageItem asset) => InternalEditorUtility.IsScriptOrAssembly(asset.assetPath)))
         {
             source = PackageUtility.BuildExportPackageItemsList(guids.Union(InternalEditorUtility.GetAllScriptGUIDs()).ToArray <string>(), includeDependencies);
         }
     }
     return((from val in source
             where val.assetPath != "Assets"
             select val).ToArray <ExportPackageItem>());
 }
Example #4
0
        internal static IEnumerable <ExportPackageItem> GetAssetItemsForExport(ICollection <string> guids, bool includeDependencies)
        {
            // if nothing is selected, export all
            if (0 == guids.Count)
            {
                string[] temp = new string[0]; // <--- I dont get this API
                guids = new HashSet <string>(AssetDatabase.CollectAllChildren(AssetDatabase.assetFolderGUID, temp));
            }

            ExportPackageItem[] assets = PackageUtility.BuildExportPackageItemsList(guids.ToArray(), includeDependencies);

            // If any scripts are included, add all scripts with dependencies
            if (includeDependencies && assets.Any(asset => UnityEditorInternal.InternalEditorUtility.IsScriptOrAssembly(asset.assetPath)))
            {
                assets = PackageUtility.BuildExportPackageItemsList(
                    guids.Union(UnityEditorInternal.InternalEditorUtility.GetAllScriptGUIDs()).ToArray(), includeDependencies);
            }

            // If the user exports the root Assets folder, we need to remove it from the list
            // explicitly, as it doesnt make sense
            assets = assets.Where(val => val.assetPath != "Assets").ToArray();

            return(assets);
        }