From 7572385cb00007f6c82751f645f8554315deb3d3 Mon Sep 17 00:00:00 2001 From: GuoLei Date: Mon, 5 Apr 2021 14:35:28 +0800 Subject: [PATCH] Revert "Change AssetType enum type (#161)" This reverts commit f19b0031e98768afa4c4259c1ece903b41944bdc. --- packages/core/src/asset/AssetType.ts | 24 +++++++++++++----------- packages/core/src/asset/LoadItem.ts | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/core/src/asset/AssetType.ts b/packages/core/src/asset/AssetType.ts index a3b8438a1f..8fbe10b2ea 100644 --- a/packages/core/src/asset/AssetType.ts +++ b/packages/core/src/asset/AssetType.ts @@ -6,31 +6,33 @@ export enum AssetType { * Plain text. * @remarks Will not be cached based on url in ResourceManager. */ - Text = "text", + Text = 0, /** * JSON. * @remarks Will not be cached based on url in ResourceManager. */ - JSON = "json", + JSON = 1, /** * ArrayBuffer. * @remarks Will not be cached based on url in ResourceManager. */ - Buffer = "buffer", + Buffer = 2, /** 2D Texture. */ - Texture2D = "texture2d", + Texture2D = 3, /** Cube Texture. */ - TextureCube = "texture-cube", + TextureCube = 4, /** Material. */ - Material = "material", + Material = 5, /** Mesh. */ - Mesh = "mesh", + Mesh = 6, /** Animation Clip. */ - AnimationClip = "animation-clip", + AnimationClip = 7, /** Prefab.*/ - Perfab = "prefab", + Perfab = 8, /** Compress Texture. */ - KTX = "ktx", + KTX = 9, /** Cube Compress Texture. */ - KTXCube = "ktx-cube" + KTXCube = 10 + /** @todo Scene. */ + // Scene = 9 } diff --git a/packages/core/src/asset/LoadItem.ts b/packages/core/src/asset/LoadItem.ts index 71b3770ed2..3e6a96e63a 100644 --- a/packages/core/src/asset/LoadItem.ts +++ b/packages/core/src/asset/LoadItem.ts @@ -15,7 +15,7 @@ export type LoadItem = { /** * Asset Type. */ - type?: string; + type?: AssetType; /** * Number of retries after failed loading. */