Ejemplo n.º 1
0
    protected Dictionary <string, List <AssetDataInfo> > GetAllDatas()
    {
        Dictionary <string, List <AssetDataInfo> > datas = new Dictionary <string, List <AssetDataInfo> >();

        Dictionary <string, List <AssetDataInfo> > fenBaoAllPackage = serverFenbao.GetAllPackage();
        Dictionary <string, List <AssetDataInfo> > abAll            = serverAssetBundle.GetAllAssetBundle();

        var itr = fenBaoAllPackage.Keys.GetEnumerator();

        while (itr.MoveNext())
        {
            if (!datas.ContainsKey(itr.Current))
            {
                datas.Add(itr.Current, new List <AssetDataInfo>());
            }
            datas[itr.Current].AddRange(fenBaoAllPackage[itr.Current]);
        }
        itr.Dispose();

        var abItr = abAll.Keys.GetEnumerator();

        while (abItr.MoveNext())
        {
            if (datas.ContainsKey(abItr.Current))
            {
                Debug.LogError("分包版本和散包版本相同??????" + abItr.Current);
                break;
            }
            datas.Add(abItr.Current, new List <AssetDataInfo>());
            datas[abItr.Current].AddRange(abAll[abItr.Current]);
        }
        abItr.Dispose();

        return(datas);
    }
Ejemplo n.º 2
0
    public override void WriteUpToDate()
    {
        IServerVersionFileManifest versionFileManifest        = FileManifestManager.Get <IServerVersionFileManifest>();
        IServerFenbaoFileManifest  serverFenbao               = FileManifestManager.Get <IServerFenbaoFileManifest>();
        Dictionary <string, List <AssetDataInfo> > assetDatas = serverFenbao.GetAllPackage();

        List <string> allZipVersion = versionFileManifest.GetZipAllVersion();
        string        lastVersion   = allZipVersion[allZipVersion.Count - 1];

        if (assetDatas.ContainsKey(lastVersion))
        {
            Dictionary <string, AssetDataInfo> temp = new Dictionary <string, AssetDataInfo>();

            var itr = assetDatas[lastVersion].GetEnumerator();
            while (itr.MoveNext())
            {
                itr.Current.IsCompressed = true;
                temp.Add(itr.Current.Name, itr.Current);
            }
            itr.Dispose();

            WriteToLocal(temp, true);
        }
    }