| | 1 | | using Cysharp.Threading.Tasks; |
| | 2 | | using System.IO; |
| | 3 | | using System.Threading; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | namespace DCL.Providers |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Local Asset Bundles support, if you have the asset bundles in that folder, we are going to load them from there. |
| | 10 | | /// This is a debug feature |
| | 11 | | /// </summary> |
| | 12 | | public class EditorAssetBundleProvider : IAssetBundleProvider |
| | 13 | | { |
| | 14 | | public UniTask<AssetBundle> GetAssetBundleAsync(string contentUrl, string hash, CancellationToken cancellationTo |
| | 15 | | { |
| 29 | 16 | | string localUrl = Application.dataPath + "/../AssetBundles/" + hash; |
| | 17 | |
|
| 29 | 18 | | if (File.Exists(localUrl)) |
| 0 | 19 | | return UniTask.FromResult(AssetBundle.LoadFromFile(localUrl)); |
| | 20 | |
|
| 29 | 21 | | return UniTask.FromResult<AssetBundle>(null); |
| | 22 | | } |
| | 23 | | } |
| | 24 | | } |