Ejemplo n.º 1
0
        private void ProcessOneSpriteAtlas(ResInfo resInfo)
        {
            List <OneInfo> deps = resInfo.depends;

            foreach (var dep in deps)
            {
                if (dep.Type != InfoType.RES)
                {
                    continue;
                }
                ResInfo oneRes = dep as ResInfo;
                if (oneRes.IsTexture())
                {
                    oneRes.bundleExclude = true;
                    List <string> refBy = oneRes.refBy;
                    if (null != refBy)
                    {
                        foreach (var oneRefStr in refBy)
                        {
                            if (totals.ContainsKey(oneRefStr))
                            {
                                OneInfo refInfo = totals[oneRefStr];
                                if (refInfo.Type == InfoType.RES && ((ResInfo)refInfo).IsTexture())
                                {
                                    continue;
                                }
                                refInfo.RemoveDepend(oneRes);
                                refInfo.AddDepend(resInfo);//依赖于spriteAtlas
                                resInfo.RefBy(refInfo.res);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void ProcessOneInfo(OneInfo oneInfo, string[] ignorePatterns)
 {
     if (totals.ContainsKey(oneInfo.res))
     {
         return;
     }
     totals.Add(oneInfo.res, oneInfo);
     if (oneInfo.NoNeedCheckDepend())
     {
         return;
     }
     string[] deps = AssetDatabase.GetDependencies(oneInfo.res, false);
     if (null == deps)
     {
         return;
     }
     foreach (var dep in deps)
     {
         if (dep.Equals(oneInfo.res))
         {
             continue;
         }
         OneInfo info = null;
         if (totals.ContainsKey(dep))
         {
             info = totals[dep];
             info.RefBy(oneInfo.res);
             oneInfo.AddDepend(info);
         }
         else if (!IsResIgnore(dep, ignorePatterns))
         {
             bool isPrefab = dep.EndsWith(".prefab", StringComparison.OrdinalIgnoreCase);
             if (isPrefab)
             {
                 info = GetOrCreatePrefabInfo(dep);
             }
             else
             {
                 info = GetOrCreateResInfo(dep);
             }
             info.RefBy(oneInfo.res);
             oneInfo.AddDepend(info);
             ProcessOneInfo(info, ignorePatterns);
         }
     }
 }