Ejemplo n.º 1
0
        public void SetOptions(VFSGroupOption option)
        {
            mOption   = option;
            GroupName = option.GroupName;
            foreach (var path in option.FolderPaths)
            {
                if (!path.EndsWith("/"))
                {
                    string _path = path + "/";
                    FolderPaths.Add(_path);
                    FolderPathsLower.Add(_path.ToLower());
                }
                else
                {
                    FolderPaths.Add(path);
                    FolderPathsLower.Add(path.ToLower());
                }
            }

            foreach (var path in option.AssetPaths)
            {
                AssetPaths.Add(path);
                AssetPathsLower.Add(path.ToLower());
            }

            //忽略子目录,子目录必须是FolderPaths的子目录,这里初始化的时候过滤一下无效的配置,节省后面的运算
            foreach (var path in option.IgnoreSubPath)
            {
                string _path      = (path.EndsWith("/")) ? path : path + "/";
                string path_lower = _path.ToLower();
                foreach (var folder in FolderPathsLower)
                {
                    if (VFSUtil.IsSubpath(path_lower, folder, false))
                    {
                        IgnoreSubpath.Add(_path);
                        IgnoreSubpathLower.Add(path_lower);
                        break;
                    }
                }
            }

            //忽略后缀名
            foreach (var ext in option.IngnoreExtName)
            {
                IgnoreExtensionLower.Add(ext.StartsWith(".") ? ext.ToLower() : "." + ext.ToLower());
            }

            //特殊打包规则
            foreach (var rule in option.FolderSpecialBuildRules)
            {
                bool flag = true;
                if (rule.DevType == FolderBuildDevelopType.normal && rule.BuildType == FolderBuildType.normal)
                {
                    flag = false;//这是条没必要的规则
                }
                if (rule.FolderPath.IsNullOrEmpty() || rule.FolderPath.IsNullOrWhiteSpace())
                {
                    flag = false;
                }

                string _folder_path  = (rule.FolderPath.EndsWith("/")) ? rule.FolderPath : rule.FolderPath + "/";
                string _folder_lower = _folder_path.ToLower();

                if (!IsSubfolderOfFolderList(_folder_path))
                {
                    flag = false;
                }

                if (flag)
                {
                    var _rule = rule;
                    _rule.FolderPath = _folder_path;
                    var lower_rule = rule;
                    lower_rule.FolderPath = _folder_lower;
                    SpecialFolderBuildRules.Add(_rule);
                    SpecialFolderBuildRulesLower.Add(lower_rule);
                }
            }
        }
Ejemplo n.º 2
0
 public VFSGroup(VFSGroupOption option)
 {
     this.SetOptions(option);
     ABLoader = new Loader.AssetBundleLoader();
 }
Ejemplo n.º 3
0
 public VFSExtensionGroup(VFSGroupOption option, bool available_web_vfs) : base(option)
 {
     this.WebVFS_Available = available_web_vfs;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 手动指定Package路径
 /// </summary>
 /// <param name="option"></param>
 /// <param name="ExtensionPackageFolder"></param>
 public VFSExtensionGroup(VFSGroupOption option, string ExtensionPackageFolder, bool available_web_vfs) : base(option)
 {
     this.OverridePackagePath  = true;
     this.PackagePathSpecified = ExtensionPackageFolder;
     this.WebVFS_Available     = available_web_vfs;
 }
Ejemplo n.º 5
0
 public VFSExtensionGroup(VFSGroupOption option) : base(option)
 {
 }