Example #1
0
        /// <summary>
        /// 对比
        /// 原则上认为StreamingAsset资源为母包携带,且完整
        /// </summary>
        private Queue <AssetItem> Compare(List <AssetItem> localAssetsInfo, List <AssetItem> serverAssetsInfo, RuntimePlatform platform)
        {
            var diffQueue = new Queue <AssetItem>();

            //比对平台
            foreach (var serverAsset in serverAssetsInfo)
            {
                //比较本地配置是否有 hash、文件名一致的资源
                var result = localAssetsInfo.FirstOrDefault((info) => serverAsset.Equals(info));
                //不存在
                if (result == null)
                {
                    diffQueue.Enqueue(serverAsset);
                }
                else
                {
                    if (!BResources.IsExsitAsset(platform, serverAsset.LocalPath, serverAsset.HashName))
                    {
                        diffQueue.Enqueue(serverAsset);
                    }
                }
            }


            return(diffQueue);
        }