GetFilePathsInFolder() public static method

public static GetFilePathsInFolder ( string folderPath, bool includeHidden = false, bool includeMeta = !AssetBundleGraphSettings.IGNORE_META ) : List
folderPath string
includeHidden bool
includeMeta bool
return List
示例#1
0
        public static AssetImporter GetReferenceAssetImporter(NodeData node)
        {
            var sampleFileDir = FileUtility.PathCombine(AssetBundleGraphSettings.IMPORTER_SETTINGS_PLACE, node.Id);

            UnityEngine.Assertions.Assert.IsTrue(Directory.Exists(sampleFileDir));

            var sampleFiles = FileUtility.GetFilePathsInFolder(sampleFileDir)
                              .Where(path => !path.EndsWith(AssetBundleGraphSettings.UNITY_METAFILE_EXTENSION))
                              .ToList();

            UnityEngine.Assertions.Assert.IsTrue(sampleFiles.Count == 1);

            return(AssetImporter.GetAtPath(sampleFiles[0]));
        }
示例#2
0
        public static ConfigStatus GetConfigStatus(NodeData node)
        {
            var sampleFileDir = FileUtility.PathCombine(AssetBundleGraphSettings.IMPORTER_SETTINGS_PLACE, node.Id);

            if (!Directory.Exists(sampleFileDir))
            {
                return(ConfigStatus.NoSampleFound);
            }

            var sampleFiles = FileUtility.GetFilePathsInFolder(sampleFileDir)
                              .Where(path => !path.EndsWith(AssetBundleGraphSettings.UNITY_METAFILE_EXTENSION))
                              .ToList();

            if (sampleFiles.Count == 0)
            {
                return(ConfigStatus.NoSampleFound);
            }
            if (sampleFiles.Count == 1)
            {
                return(ConfigStatus.GoodSampleFound);
            }

            return(ConfigStatus.TooManySamplesFound);
        }
示例#3
0
        public static List <string> GetCachedDataByNode(BuildTarget t, NodeData node)
        {
            switch (node.Kind)
            {
            case NodeKind.IMPORTSETTING_GUI: {
                // no cache file exists for importSetting.
                return(new List <string>());
            }

            case NodeKind.MODIFIER_GUI: {
                // no cache file exists for modifier.
                return(new List <string>());
            }

            case NodeKind.PREFABBUILDER_GUI: {
                var cachedPathBase = FileUtility.PathCombine(
                    AssetBundleGraphSettings.PREFABBUILDER_CACHE_PLACE,
                    node.Id,
                    SystemDataUtility.GetPathSafeTargetName(t)
                    );

                // no cache folder, no cache.
                if (!Directory.Exists(cachedPathBase))
                {
                    // search default platform + package
                    cachedPathBase = FileUtility.PathCombine(
                        AssetBundleGraphSettings.PREFABBUILDER_CACHE_PLACE,
                        node.Id,
                        SystemDataUtility.GetPathSafeDefaultTargetName()
                        );

                    if (!Directory.Exists(cachedPathBase))
                    {
                        return(new List <string>());
                    }
                }

                return(FileUtility.GetFilePathsInFolder(cachedPathBase));
            }

            case NodeKind.BUNDLECONFIG_GUI: {
                // do nothing.
                break;
            }

            case NodeKind.BUNDLEBUILDER_GUI: {
                var cachedPathBase = FileUtility.PathCombine(
                    AssetBundleGraphSettings.BUNDLEBUILDER_CACHE_PLACE,
                    node.Id,
                    SystemDataUtility.GetPathSafeTargetName(t)
                    );

                // no cache folder, no cache.
                if (!Directory.Exists(cachedPathBase))
                {
                    // search default platform + package
                    cachedPathBase = FileUtility.PathCombine(
                        AssetBundleGraphSettings.BUNDLEBUILDER_CACHE_PLACE,
                        node.Id,
                        SystemDataUtility.GetPathSafeDefaultTargetName()
                        );

                    if (!Directory.Exists(cachedPathBase))
                    {
                        return(new List <string>());
                    }
                }

                return(FileUtility.GetFilePathsInFolder(cachedPathBase));
            }

            default: {
                // nothing to do.
                break;
            }
            }
            return(new List <string>());
        }