private void SetAssetbundleNameByFilter(BuildAssetsRefrenceFilter filter)
 {
     foreach (var elem in filter.filter)
     {
         int refrenceCount = elem.Key;
         if (refrenceCount == 0)
         {
             Debug.LogError("error refrence count ");
             continue;
         }
         else if (refrenceCount == 1)
         {
             foreach (var subElem in elem.Value)
             {
                 var mainAsset = subElem.Key;
                 foreach (var asset in subElem.Value)
                 {
                     SetAssetBundleName(asset.assetInfo, mainAsset);
                 }
             }
         }
         else
         {
             HandleAssets(refrenceCount, elem.Value);
         }
     }
 }
        private BuildAssetsRefrenceFilter FilterByRerenceCount(List <BuildAssetElemmentInfo> targetList)
        {
            BuildAssetsRefrenceFilter res = new BuildAssetsRefrenceFilter();

            // first key - refrence count ,second key - assets group ,main assets
            // value - child list
            res.filter = new Dictionary <int, Dictionary <AssetInfo, List <BuildAssetElementChildInfo> > >();

            foreach (var elem in targetList)
            {
                foreach (var subElem in elem.depAssetsList)
                {
                    if (!res.filter.ContainsKey(subElem.refCount))
                    {
                        res.filter.Add(subElem.refCount, new Dictionary <AssetInfo, List <BuildAssetElementChildInfo> >());
                    }
                    if (!res.filter[subElem.refCount].ContainsKey(elem.mainAssetInfo))
                    {
                        res.filter[subElem.refCount].Add(elem.mainAssetInfo, new List <BuildAssetElementChildInfo>());
                    }
                    res.filter[subElem.refCount][elem.mainAssetInfo].Add(subElem);
                }
            }
            return(res);
        }