Ejemplo n.º 1
0
 /// <summary>
 /// 判断当前文件是否为指定目标的忽略文件.
 /// </summary>
 /// <returns><c>true</c>, 忽略文件, <c>false</c> 非忽略文件.</returns>
 /// <param name="iTarget">目标.</param>
 /// <param name="iTargetFile">目标文件.</param>
 public bool IsIgnoreFile(BundleResource iTarget, string iTargetFile)
 {
     if (iTarget?.ignoreList == null || string.IsNullOrEmpty(iTargetFile))
     {
         return(false);
     }
     return(iTarget.IsIgnoreTargetExist(iTargetFile));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加资源信息.
 /// </summary>
 /// <param name="iResourceInfo">资源信息.</param>
 public BundleResource AddResource(BundleResource iResourceInfo)
 {
     if (null == data)
     {
         return(null);
     }
     if (null == iResourceInfo)
     {
         return(null);
     }
     return(data.AddResource(
                iResourceInfo.mode, iResourceInfo.path,
                iResourceInfo.ignoreList));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 追加资源.
        /// </summary>
        /// <param name="iMode">打包模式.</param>
        /// <param name="iResourcePath">资源路径</param>
        /// <param name="iIgnoreList">忽略列表.</param>
        public BundleResource AddResource(
            BundleMode iMode,
            string iResourcePath,
            List <string> iIgnoreList)
        {
            if (string.IsNullOrEmpty(iResourcePath))
            {
                return(null);
            }

            BundleResource target = null;

            foreach (var loop in resources)
            {
                if (false == iResourcePath.Equals(loop.path))
                {
                    continue;
                }
                target = loop;
                break;
            }

            // 不存在
            if (null == target)
            {
                target = new BundleResource();
                resources.Add(target);
                target.mode       = iMode;
                target.path       = iResourcePath;
                target.ignoreList = iIgnoreList;
            }
            else
            {
                target.mode = iMode;
                if (null == iIgnoreList || 1 > iIgnoreList.Count)
                {
                    return(target);
                }
                foreach (var ignore in iIgnoreList)
                {
                    target.AddIgnoreTarget(ignore);
                }
            }

            return(target);
        }