From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XUtliPoolLib/IOSAssetBundleLoader.cs | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Client/Assets/Scripts/XUtliPoolLib/IOSAssetBundleLoader.cs (limited to 'Client/Assets/Scripts/XUtliPoolLib/IOSAssetBundleLoader.cs') diff --git a/Client/Assets/Scripts/XUtliPoolLib/IOSAssetBundleLoader.cs b/Client/Assets/Scripts/XUtliPoolLib/IOSAssetBundleLoader.cs new file mode 100644 index 00000000..13bfada3 --- /dev/null +++ b/Client/Assets/Scripts/XUtliPoolLib/IOSAssetBundleLoader.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections; +using UnityEngine; + +namespace XUtliPoolLib +{ + public class IOSAssetBundleLoader : MobileAssetBundleLoader + { + protected override IEnumerator LoadFromPackage() + { + bool flag = this.state == LoadState.State_Complete; + if (flag) + { + this.Complete(); + } + else + { + bool flag2 = this.state != LoadState.State_Error; + if (flag2) + { + AssetBundleCreateRequest req = AssetBundle.LoadFromFileAsync(this._assetBundleSourceFile); + while (!req.isDone) + { + yield return null; + } + bool flag3 = this._bundle == null; + if (flag3) + { + this._bundle = req.assetBundle; + } + bool flag4 = this.state != LoadState.State_Complete && base.UnloadNotLoadingBundle(this._bundle); + if (flag4) + { + req = AssetBundle.LoadFromFileAsync(this._assetBundleSourceFile); + while (!req.isDone) + { + yield return null; + } + bool flag5 = this._bundle == null; + if (flag5) + { + this._bundle = req.assetBundle; + } + } + this.Complete(); + req = null; + } + } + yield break; + } + + protected override void LoadFromPackageImm() + { + bool flag = this.state == LoadState.State_Complete; + if (flag) + { + this.Complete(); + } + else + { + bool flag2 = this.state != LoadState.State_Error; + if (flag2) + { + bool flag3 = this._bundle == null; + if (flag3) + { + this._bundle = AssetBundle.LoadFromFile(this._assetBundleSourceFile); + } + bool flag4 = this.state != LoadState.State_Complete && base.UnloadNotLoadingBundle(this._bundle); + if (flag4) + { + bool flag5 = this._bundle == null; + if (flag5) + { + this._bundle = AssetBundle.LoadFromFile(this._assetBundleSourceFile); + } + } + this.Complete(); + } + } + } + } +} -- cgit v1.1-26-g67d0