public override bool Update()
        {
            if (operation != null)
            {
                return(false);
            }

            AssetBundleRes bundle = AssetsBundleManager.GetLoadedAssetBundle(assetBundleName, out downloadingError);

            if (bundle != null)
            {
                if (isAdditive)
                {
                    operation = SceneManager.LoadSceneAsync(sceneName);
                }
                else
                {
                    operation = SceneManager.LoadSceneAsync(sceneName);
                }
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemple #2
0
        /// <summary>
        /// 如果需要更多Update调用,则返回true。
        /// </summary>
        /// <returns></returns>
        public override bool Update()
        {
            if (request != null)
            {
                return(false);
            }
            AssetBundleRes assetBundleRes = AssetsBundleManager.GetLoadedAssetBundle(assetBundleName, out downloadingError);

            if (assetBundleRes != null)
            {
                ///@TODO: 当资产包下载失败时,会抛出异常。
                request = assetBundleRes.assetbundle.LoadAssetAsync(assetName, this.type);
                return(false);
            }
            else
            {
                return(true);
            }
        }