using System; using System.Collections.Generic; using System.IO; using UnityEngine; /// /// [OBSOLETE] 已被 YooAssetInitTask 替代。 /// 此类不再在启动流水线中使用。保留仅供历史参考。 /// [Obsolete("Replaced by YooAssetInitTask. This class is no longer in the startup pipeline.")] public class AssetBundleInitTask : LaunchTask { public override float expectTime { get { return LocalSave.GetFloat("AssetBundleInitTask_ExpectTime", 1f); } protected set { LocalSave.SetFloat("AssetBundleInitTask_ExpectTime", value); } } public override void Begin() { LaunchInHot.m_CurrentStage = LaunchStage.AssetBundleInit; duration = Mathf.Max(0.5f, expectTime); if (AssetSource.isUseAssetBundle) { AssetBundleUtility.Instance.Initialize(); done = false; progress = 0f; } else { done = true; } } public override void End() { expectTime = timer; // UILoader.LoadWindowAsync("LaunchBackGroundWin", null); Debug.LogFormat("{0}执行时长:{1};", this.GetType().Name, timer); } public override void Update() { if (done) { return; } if (AssetBundleUtility.Instance.initialized && AssetBundleUtility.Instance.initializedUIAssetBundle) { done = true; } else { done = false; progress = timer / duration; } ExceptionReport(); } }