| | 1 | | using System; |
| | 2 | |
|
| | 3 | | namespace DCL |
| | 4 | | { |
| | 5 | | public class AssetPromise_PrefetchGLTF : AssetPromise_GLTF |
| | 6 | | { |
| 0 | 7 | | public AssetPromise_PrefetchGLTF(ContentProvider provider, string url, string hash) : base(provider, url, hash) |
| | 8 | |
|
| 0 | 9 | | protected override void OnBeforeLoadOrReuse() { asset.container.name = "GLTF: " + fileName; } |
| | 10 | |
|
| 0 | 11 | | void ParseGLTFWebRequestedFile(ref string requestedFileName) { provider.TryGetContentsUrl(assetDirectoryPath + r |
| | 12 | |
|
| 0 | 13 | | protected override void OnReuse(Action OnSuccess) { asset.Show(false, OnSuccess); } |
| | 14 | |
|
| | 15 | | protected override bool AddToLibrary() |
| | 16 | | { |
| 0 | 17 | | library.Add(asset); |
| 0 | 18 | | return true; |
| | 19 | | } |
| | 20 | |
|
| | 21 | | internal override void Load() |
| | 22 | | { |
| 0 | 23 | | if (!library.Contains(GetId())) |
| | 24 | | { |
| 0 | 25 | | base.Load(); |
| 0 | 26 | | } |
| | 27 | | else |
| | 28 | | { |
| 0 | 29 | | CallAndClearEvents(false, new Exception("The asset already exists in the library")); |
| | 30 | | } |
| 0 | 31 | | } |
| | 32 | |
|
| 0 | 33 | | protected override void OnCancelLoading() { base.OnCancelLoading(); } |
| | 34 | |
|
| 0 | 35 | | protected override Asset_GLTF GetAsset(object id) { return library.Get(id); } |
| | 36 | | } |
| | 37 | | } |