Пример #1
0
        /// <summary>
        /// 检测是否需要热更新
        /// </summary>
        /// <param name="item"></param>
        /// <param name="remoteVersionConfig"></param>
        /// <param name="streamingVersionConfig"></param>
        /// <returns></returns>
        public bool CheckModuleNeedLoad(ResGroupData item, VersionConfig remoteVersionConfig, VersionConfig streamingVersionConfig)
        {
            Log.Debug("检查是否需要热更新.....");

            this.Reset();//重置

            if (item.ResNames.Length == 0)
            {
                return(false);
            }

            foreach (string AbName in item.ResNames)
            {
                CheckABLoad(AbName, remoteVersionConfig, streamingVersionConfig);
            }

            Log.Debug("需要加载的AB资源数量:" + this.bundles.Count);

            if (this.bundles.Count > 0)
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
        /// <summary>
        /// 检测更新
        /// </summary>
        /// <param name="item"></param>
        /// <param name="remoteVersionConfig"></param>
        /// <param name="streamingVersionConfig"></param>
        public async void CheckUpdate(ResGroupData item, VersionConfig remoteVersionConfig, VersionConfig streamingVersionConfig)
        {
            Log.Debug("检查更新.....");

            this.Reset();//重置

            if (item.ResNames.Length == 0)
            {
                return;
            }

            foreach (string AbName in item.ResNames)
            {
                CheckABLoad(AbName, remoteVersionConfig, streamingVersionConfig);
            }

            Log.Debug("需要加载的AB资源数量:" + this.bundles.Count);

            if (this.bundles.Count > 0)
            {
                StartAsync().Coroutine();

                CheckDownLoadTimeOut().Coroutine();

                await this.DownloadAsync();
            }
            else
            {
                Log.Debug("不需要下载任何资源!!!!!");

                this.UpdateFlag.gameObject.SetActive(false);
            }
        }