예제 #1
0
        private void GetResFromDir(ResDir dir)
        {
            if (dir.ignore)
            {
                return;
            }
            List <string> files = FileUtils.GetFiles(dir.path, dir.filePattern);
            string        shaderBundleSingleName = null;

            foreach (var file in files)
            {
                if (resList.ContainsKey(file))
                {
                    continue;
                }
                ResInfo resInfo = new ResInfo()
                {
                    res      = file,
                    dir      = dir,
                    refBy    = null,
                    refCount = 0,
                    depends  = null,
                };
                resList.Add(file, resInfo);
            }
        }
예제 #2
0
        private void GetResList()
        {
            resList = new Dictionary <string, ResInfo>();
            string _progressTitle = "获取基础资源";

            EditorUtility.DisplayProgressBar(_progressTitle, "", 0);
            for (int i = 0; i < resDirs.Count; ++i)
            {
                ResDir dir = resDirs[i];
                GetResFromDir(dir);
                EditorUtility.DisplayProgressBar(_progressTitle, dir.path, (float)(i + 1) / resDirs.Count);
            }
            EditorUtility.ClearProgressBar();
        }
예제 #3
0
        private void GetResFromDir(ResDir dir)
        {
            if (dir.ignore)
            {
                return;
            }
            List <string> files = FileUtils.GetFiles(dir.path, dir.filePattern);
            string        shaderBundleSingleName = null;

            foreach (var file in files)
            {
                if (resList.ContainsKey(file))
                {
                    continue;
                }
                ResInfo resInfo = new ResInfo()
                {
                    res      = file,
                    dir      = dir,
                    refBy    = null,
                    refCount = 0,
                    depends  = null,
                };
                if (dir.bundleType == BundleType.Single)
                {
                    if (resInfo.IsShaderAsset())
                    {
                        string bundleBasicName = resInfo.GetShaderBundleBasicName();
                        if (null != bundleBasicName)
                        {
                            if (null == shaderBundleSingleName)
                            {
                                shaderBundleSingleName = dir.path.Replace('/', '_');
                            }
                            ResDataHelp.shadersAsSingleNames[bundleBasicName] = shaderBundleSingleName;
                        }
                    }
                }
                resList.Add(file, resInfo);
            }
        }