@galacean/engine-loader 1.5.9 → 1.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Utils, AssetPromise, AnimationClip, AnimationEvent, Loader, AnimationStringCurve, Keyframe, AnimationBoolCurve, AnimationRefCurve, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, ModelMesh, BlendShape, Entity, Transform, Texture2D, resourceLoader, ContentRestorer, ReferResource, Scene, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateTransition, AmbientLight, DiffuseMode, TextureCube, TextureFilterMode, TextureCubeFace, Font, SystemInfo, Animator, Logger, IndexFormat, VertexElementFormat, GLCapabilityType, TextureFormat, request, InterpolationType, SkinnedMeshRenderer, PBRMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Camera, MeshRenderer, Skin, TextureWrapMode as TextureWrapMode$1, AnimatorStateMachine, Shader, Material, PrimitiveMesh, SpriteAtlas, Sprite, TextureUtils, AudioClip, AudioManager, ShaderFactory, ShaderLib, PhysicsMaterial, BackgroundMode, DirectLight, PointLight, SpotLight, UnlitMaterial } from '@galacean/engine-core';
1
+ import { Utils, AssetPromise, AnimationClip, AnimationEvent, Loader, AnimationStringCurve, Keyframe, AnimationBoolCurve, AnimationRefCurve, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, ModelMesh, BlendShape, Entity, Transform, Texture2D, ReferResource, resourceLoader, ContentRestorer, Scene, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateTransition, AmbientLight, DiffuseMode, TextureCube, TextureFilterMode, TextureCubeFace, Font, SystemInfo, Animator, Logger, IndexFormat, VertexElementFormat, GLCapabilityType, TextureFormat, request, InterpolationType, SkinnedMeshRenderer, PBRMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Camera, MeshRenderer, Skin, TextureWrapMode as TextureWrapMode$1, AnimatorStateMachine, Shader, Material, PrimitiveMesh, SpriteAtlas, Sprite, TextureUtils, AudioClip, AudioManager, ShaderFactory, ShaderLib, PhysicsMaterial, BackgroundMode, DirectLight, PointLight, SpotLight, UnlitMaterial } from '@galacean/engine-core';
2
2
  import { Quaternion, Vector4, Color, Vector3, Vector2, SphericalHarmonics3, MathUtil, BoundingBox, Matrix, Rect } from '@galacean/engine-math';
3
3
  import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
4
4
 
@@ -957,53 +957,6 @@ Texture2DDecoder = __decorate([
957
957
  decoder("Texture2D")
958
958
  ], Texture2DDecoder);
959
959
 
960
- var EditorTextureLoader = /*#__PURE__*/ function(Loader) {
961
- _inherits(EditorTextureLoader, Loader);
962
- function EditorTextureLoader() {
963
- return Loader.apply(this, arguments) || this;
964
- }
965
- var _proto = EditorTextureLoader.prototype;
966
- _proto.load = function load(item, resourceManager) {
967
- var requestConfig = _extends({}, item, {
968
- type: "arraybuffer"
969
- });
970
- var url = item.url;
971
- return new AssetPromise(function(resolve, reject) {
972
- resourceManager// @ts-ignore
973
- ._request(url, requestConfig).then(function(data) {
974
- decode(data, resourceManager.engine).then(function(texture) {
975
- resourceManager.addContentRestorer(new EditorTexture2DContentRestorer(texture, url, requestConfig));
976
- resolve(texture);
977
- });
978
- }).catch(reject);
979
- });
980
- };
981
- return EditorTextureLoader;
982
- }(Loader);
983
- EditorTextureLoader = __decorate([
984
- resourceLoader("EditorTexture2D", [
985
- "prefab"
986
- ], true)
987
- ], EditorTextureLoader);
988
- var EditorTexture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
989
- _inherits(EditorTexture2DContentRestorer, ContentRestorer);
990
- function EditorTexture2DContentRestorer(resource, url, requestConfig) {
991
- var _this;
992
- _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
993
- return _this;
994
- }
995
- var _proto = EditorTexture2DContentRestorer.prototype;
996
- _proto.restoreContent = function restoreContent() {
997
- var texture = this.resource;
998
- var engine = texture.engine;
999
- return engine.resourceManager// @ts-ignore
1000
- ._request(this.url, this.requestConfig).then(function(data) {
1001
- return decode(data, engine, texture);
1002
- });
1003
- };
1004
- return EditorTexture2DContentRestorer;
1005
- }(ContentRestorer);
1006
-
1007
960
  function _instanceof(left, right) {
1008
961
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1009
962
  return !!right[Symbol.hasInstance](left);
@@ -1261,6 +1214,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1261
1214
  var transform = entityConfig.transform;
1262
1215
  var entity = new Entity(engine, entityConfig.name, transform ? Loader.getClass(transform.class) : Transform);
1263
1216
  if (!entityConfig.parent) this.context.rootIds.push(entityConfig.id);
1217
+ this._addEntityPlugin(entityConfig.id, entity);
1264
1218
  return Promise.resolve(entity);
1265
1219
  };
1266
1220
  _proto._parsePrefab = function _parsePrefab(entityConfig, engine) {
@@ -1324,6 +1278,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1324
1278
  var component = entity.addComponent(Loader.getClass(key));
1325
1279
  componentMap.set(componentId, component);
1326
1280
  componentConfigMap.set(componentId, componentConfig);
1281
+ this._addComponentPlugin(componentId, component);
1327
1282
  }
1328
1283
  };
1329
1284
  _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
@@ -1380,9 +1335,58 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1380
1335
  }
1381
1336
  return Promise.all(promises);
1382
1337
  };
1338
+ _proto._addComponentPlugin = function _addComponentPlugin(componentId, component) {};
1339
+ _proto._addEntityPlugin = function _addEntityPlugin(entityId, entity) {};
1383
1340
  return HierarchyParser;
1384
1341
  }();
1385
1342
 
1343
+ var EditorTextureLoader = /*#__PURE__*/ function(Loader) {
1344
+ _inherits(EditorTextureLoader, Loader);
1345
+ function EditorTextureLoader() {
1346
+ return Loader.apply(this, arguments) || this;
1347
+ }
1348
+ var _proto = EditorTextureLoader.prototype;
1349
+ _proto.load = function load(item, resourceManager) {
1350
+ var requestConfig = _extends({}, item, {
1351
+ type: "arraybuffer"
1352
+ });
1353
+ var url = item.url;
1354
+ return new AssetPromise(function(resolve, reject) {
1355
+ resourceManager// @ts-ignore
1356
+ ._request(url, requestConfig).then(function(data) {
1357
+ decode(data, resourceManager.engine).then(function(texture) {
1358
+ resourceManager.addContentRestorer(new EditorTexture2DContentRestorer(texture, url, requestConfig));
1359
+ resolve(texture);
1360
+ });
1361
+ }).catch(reject);
1362
+ });
1363
+ };
1364
+ return EditorTextureLoader;
1365
+ }(Loader);
1366
+ EditorTextureLoader = __decorate([
1367
+ resourceLoader("EditorTexture2D", [
1368
+ "prefab"
1369
+ ], true)
1370
+ ], EditorTextureLoader);
1371
+ var EditorTexture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
1372
+ _inherits(EditorTexture2DContentRestorer, ContentRestorer);
1373
+ function EditorTexture2DContentRestorer(resource, url, requestConfig) {
1374
+ var _this;
1375
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
1376
+ return _this;
1377
+ }
1378
+ var _proto = EditorTexture2DContentRestorer.prototype;
1379
+ _proto.restoreContent = function restoreContent() {
1380
+ var texture = this.resource;
1381
+ var engine = texture.engine;
1382
+ return engine.resourceManager// @ts-ignore
1383
+ ._request(this.url, this.requestConfig).then(function(data) {
1384
+ return decode(data, engine, texture);
1385
+ });
1386
+ };
1387
+ return EditorTexture2DContentRestorer;
1388
+ }(ContentRestorer);
1389
+
1386
1390
  /** @Internal */ var SceneParser = /*#__PURE__*/ function(HierarchyParser) {
1387
1391
  _inherits(SceneParser, HierarchyParser);
1388
1392
  function SceneParser(data, context, scene) {
@@ -7438,5 +7442,5 @@ EXT_texture_webp = __decorate([
7438
7442
  registerGLTFExtension("EXT_texture_webp", GLTFExtensionMode.CreateAndParse)
7439
7443
  ], EXT_texture_webp);
7440
7444
 
7441
- export { AccessorType, AnimationClipDecoder, BufferInfo, BufferReader, EditorTextureLoader, FileHeader, GLTFAnimationParser, GLTFAnimatorControllerParser, GLTFBufferParser, GLTFBufferViewParser, GLTFEntityParser, GLTFExtensionMode, GLTFExtensionParser, GLTFLoader, GLTFMaterialParser, GLTFMeshParser, GLTFParser, GLTFParserContext, GLTFParserType, GLTFResource, GLTFSceneParser, GLTFSchemaParser, GLTFSkinParser, GLTFTextureParser, GLTFUtils, GLTFValidator, InterpolableValueType, KTX2Loader, KTX2TargetFormat, KTX2Transcoder, MaterialLoaderType, MeshDecoder, ParserContext, ParserType, PrefabResource, ReflectionParser, SceneParser, SpecularMode, Texture2DDecoder, decode, decoder, decoderMap, parseSingleKTX, registerGLTFExtension, registerGLTFParser };
7445
+ export { AccessorType, AnimationClipDecoder, BufferInfo, BufferReader, EditorTextureLoader, FileHeader, GLTFAnimationParser, GLTFAnimatorControllerParser, GLTFBufferParser, GLTFBufferViewParser, GLTFEntityParser, GLTFExtensionMode, GLTFExtensionParser, GLTFLoader, GLTFMaterialParser, GLTFMeshParser, GLTFParser, GLTFParserContext, GLTFParserType, GLTFResource, GLTFSceneParser, GLTFSchemaParser, GLTFSkinParser, GLTFTextureParser, GLTFUtils, GLTFValidator, HierarchyParser, InterpolableValueType, KTX2Loader, KTX2TargetFormat, KTX2Transcoder, MaterialLoaderType, MeshDecoder, ParserContext, ParserType, PrefabResource, ReflectionParser, SceneParser, SpecularMode, Texture2DDecoder, decode, decoder, decoderMap, parseSingleKTX, registerGLTFExtension, registerGLTFParser };
7442
7446
  //# sourceMappingURL=module.js.map