@galacean/engine-loader 0.9.12 → 0.9.14

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.
@@ -1745,6 +1745,10 @@ var EntityParser = /*#__PURE__*/ function(Parser) {
1745
1745
  }
1746
1746
  glTFResource.sceneRoots = sceneRoots;
1747
1747
  glTFResource.defaultSceneRoot = sceneRoots[sceneID];
1748
+ // @ts-ignore
1749
+ glTFResource.defaultSceneRoot._hookResource = glTFResource;
1750
+ // @ts-ignore
1751
+ glTFResource._addRefCount(1);
1748
1752
  };
1749
1753
  return EntityParser;
1750
1754
  }(Parser);
@@ -2482,36 +2486,20 @@ var GLTFParser = /*#__PURE__*/ function() {
2482
2486
 
2483
2487
  /**
2484
2488
  * Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
2485
- */ var GLTFResource = /*#__PURE__*/ function(EngineObject) {
2486
- _inherits(GLTFResource, EngineObject);
2489
+ */ var GLTFResource = /*#__PURE__*/ function(RefObject) {
2490
+ _inherits(GLTFResource, RefObject);
2487
2491
  function GLTFResource(engine, url) {
2488
2492
  var _this;
2489
- _this = EngineObject.call(this, engine) || this;
2493
+ _this = RefObject.call(this, engine) || this;
2490
2494
  _this.url = url;
2491
2495
  return _this;
2492
2496
  }
2493
2497
  var _proto = GLTFResource.prototype;
2494
2498
  /**
2495
- * @override
2496
- */ _proto.destroy = function destroy() {
2497
- if (this._destroyed) {
2498
- return;
2499
- }
2500
- EngineObject.prototype.destroy.call(this);
2501
- this.defaultSceneRoot.destroy();
2502
- this.textures = null;
2503
- this.materials = null;
2504
- this.meshes = null;
2505
- this.skins = null;
2506
- this.animations = null;
2507
- this.entities = null;
2508
- this.cameras = null;
2509
- this.lights = null;
2510
- this.sceneRoots = null;
2511
- this.variants = null;
2512
- };
2499
+ * @internal
2500
+ */ _proto._onDestroy = function _onDestroy() {};
2513
2501
  return GLTFResource;
2514
- }(miniprogram.EngineObject);
2502
+ }(miniprogram.RefObject);
2515
2503
 
2516
2504
  var GLTFLoader = /*#__PURE__*/ function(Loader) {
2517
2505
  _inherits(GLTFLoader, Loader);
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import { resourceLoader, AssetType, AssetPromise, AnimatorController, AnimatorControllerLayer, AnimatorStateMachine, AnimatorStateTransition, Loader, TextureCube, TextureFilterMode, TextureCubeFace, AmbientLight, DiffuseMode, Font, IndexFormat, VertexElementFormat, DirectLight, PointLight, SpotLight, PBRMaterial, TextureCoordinate, Logger, RenderFace, PBRSpecularMaterial, UnlitMaterial, AnimationClip, InterpolationType, AnimationFloatArrayCurve, Keyframe, AnimationQuaternionCurve, AnimationVector3Curve, SkinnedMeshRenderer, Transform, request, Entity, VertexElement, Buffer, BufferBindFlag, BufferUsage, BlendShape, ModelMesh, Camera, Animator, BlinnPhongMaterial, MeshRenderer, Skin, TextureWrapMode as TextureWrapMode$1, Texture2D, EngineObject, TextureFormat, PBRBaseMaterial, Shader, ParticleRenderer, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationEvent, AnimationColorCurve, AnimationVector4Curve, AnimationVector2Curve, AnimationArrayCurve, AnimationFloatCurve, Scene, SpriteAtlas, Sprite, BackgroundMode, SkyBoxMaterial, PrimitiveMesh } from '@galacean/engine-core';
1
+ import { resourceLoader, AssetType, AssetPromise, AnimatorController, AnimatorControllerLayer, AnimatorStateMachine, AnimatorStateTransition, Loader, TextureCube, TextureFilterMode, TextureCubeFace, AmbientLight, DiffuseMode, Font, IndexFormat, VertexElementFormat, DirectLight, PointLight, SpotLight, PBRMaterial, TextureCoordinate, Logger, RenderFace, PBRSpecularMaterial, UnlitMaterial, AnimationClip, InterpolationType, AnimationFloatArrayCurve, Keyframe, AnimationQuaternionCurve, AnimationVector3Curve, SkinnedMeshRenderer, Transform, request, Entity, VertexElement, Buffer, BufferBindFlag, BufferUsage, BlendShape, ModelMesh, Camera, Animator, BlinnPhongMaterial, MeshRenderer, Skin, TextureWrapMode as TextureWrapMode$1, Texture2D, RefObject, TextureFormat, PBRBaseMaterial, Shader, ParticleRenderer, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationEvent, AnimationColorCurve, AnimationVector4Curve, AnimationVector2Curve, AnimationArrayCurve, AnimationFloatCurve, Scene, SpriteAtlas, Sprite, BackgroundMode, SkyBoxMaterial, PrimitiveMesh } from '@galacean/engine-core';
2
2
  import { SphericalHarmonics3, Vector2, Vector3, Vector4, Color, Quaternion, Matrix, Rect } from '@galacean/engine-math';
3
3
  import { DRACODecoder } from '@galacean/engine-draco';
4
4
  import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
@@ -1740,6 +1740,10 @@ var EntityParser = /*#__PURE__*/ function(Parser) {
1740
1740
  }
1741
1741
  glTFResource.sceneRoots = sceneRoots;
1742
1742
  glTFResource.defaultSceneRoot = sceneRoots[sceneID];
1743
+ // @ts-ignore
1744
+ glTFResource.defaultSceneRoot._hookResource = glTFResource;
1745
+ // @ts-ignore
1746
+ glTFResource._addRefCount(1);
1743
1747
  };
1744
1748
  return EntityParser;
1745
1749
  }(Parser);
@@ -2477,36 +2481,20 @@ var GLTFParser = /*#__PURE__*/ function() {
2477
2481
 
2478
2482
  /**
2479
2483
  * Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
2480
- */ var GLTFResource = /*#__PURE__*/ function(EngineObject) {
2481
- _inherits(GLTFResource, EngineObject);
2484
+ */ var GLTFResource = /*#__PURE__*/ function(RefObject) {
2485
+ _inherits(GLTFResource, RefObject);
2482
2486
  function GLTFResource(engine, url) {
2483
2487
  var _this;
2484
- _this = EngineObject.call(this, engine) || this;
2488
+ _this = RefObject.call(this, engine) || this;
2485
2489
  _this.url = url;
2486
2490
  return _this;
2487
2491
  }
2488
2492
  var _proto = GLTFResource.prototype;
2489
2493
  /**
2490
- * @override
2491
- */ _proto.destroy = function destroy() {
2492
- if (this._destroyed) {
2493
- return;
2494
- }
2495
- EngineObject.prototype.destroy.call(this);
2496
- this.defaultSceneRoot.destroy();
2497
- this.textures = null;
2498
- this.materials = null;
2499
- this.meshes = null;
2500
- this.skins = null;
2501
- this.animations = null;
2502
- this.entities = null;
2503
- this.cameras = null;
2504
- this.lights = null;
2505
- this.sceneRoots = null;
2506
- this.variants = null;
2507
- };
2494
+ * @internal
2495
+ */ _proto._onDestroy = function _onDestroy() {};
2508
2496
  return GLTFResource;
2509
- }(EngineObject);
2497
+ }(RefObject);
2510
2498
 
2511
2499
  var GLTFLoader = /*#__PURE__*/ function(Loader) {
2512
2500
  _inherits(GLTFLoader, Loader);