summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XUtliPoolLib/AndroidAssetBundleLoader.cs
blob: 76e02821af50a6d5f8b87b559fb8f15ec8715da0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Collections;
using UnityEngine;

namespace XUtliPoolLib
{
	internal class AndroidAssetBundleLoader : 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();
				}
			}
		}
	}
}