@galacean/engine-core 1.3.26 → 1.3.27

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.
@@ -4074,6 +4074,28 @@ __decorate([
4074
4074
  */ Shader.find = function find(name) {
4075
4075
  return Shader._shaderMap[name];
4076
4076
  };
4077
+ /**
4078
+ * @internal
4079
+ */ Shader._clear = function _clear(engine) {
4080
+ var shaderMap = Shader._shaderMap;
4081
+ for(var key in shaderMap){
4082
+ var shader = shaderMap[key];
4083
+ var subShaders = shader._subShaders;
4084
+ for(var i = 0, n = subShaders.length; i < n; i++){
4085
+ var passes = subShaders[i].passes;
4086
+ for(var j = 0, m = passes.length; j < m; j++){
4087
+ var pass = passes[j];
4088
+ var passShaderProgramPools = pass._shaderProgramPools;
4089
+ for(var k = passShaderProgramPools.length - 1; k >= 0; k--){
4090
+ var shaderProgramPool = passShaderProgramPools[k];
4091
+ if (shaderProgramPool.engine !== engine) continue;
4092
+ shaderProgramPool._destroy();
4093
+ passShaderProgramPools.splice(k, 1);
4094
+ }
4095
+ }
4096
+ }
4097
+ }
4098
+ };
4077
4099
  Shader._applyConstRenderStates = function _applyConstRenderStates(renderState, key, value) {
4078
4100
  switch(key){
4079
4101
  case exports.RenderStateDataKey.BlendStateEnabled0:
@@ -8317,6 +8339,7 @@ var /**
8317
8339
  program.uploadUnGroupTextures();
8318
8340
  (pass._renderState || blitMaterial.renderState)._applyStates(engine, false, pass._renderStateDataMap, blitMaterial.shaderData);
8319
8341
  rhi.drawPrimitive(blitMesh._primitive, blitMesh.subMesh, program);
8342
+ rendererShaderData.setTexture(PipelineUtils._blitTextureProperty, null);
8320
8343
  };
8321
8344
  return PipelineUtils;
8322
8345
  }();
@@ -8664,6 +8687,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
8664
8687
  }
8665
8688
  this._renderPipeline.render(context, cubeFace, mipLevel, ignoreClearFlags);
8666
8689
  engine._renderCount++;
8690
+ context.camera = null;
8667
8691
  };
8668
8692
  _proto.setReplacementShader = function setReplacementShader(shader, replacementTag, failureStrategy) {
8669
8693
  if (failureStrategy === void 0) failureStrategy = exports.ReplacementFailureStrategy.KeepOriginalShader;
@@ -9413,10 +9437,8 @@ var ContextRendererUpdateFlag;
9413
9437
  _proto._drawMask = function _drawMask(context, pipelineStageTagValue, master) {
9414
9438
  var incrementMaskQueue = MaskManager.getMaskIncrementRenderQueue();
9415
9439
  incrementMaskQueue.renderQueueType = this.renderQueueType;
9416
- incrementMaskQueue.clear();
9417
9440
  var decrementMaskQueue = MaskManager.getMaskDecrementRenderQueue();
9418
9441
  decrementMaskQueue.renderQueueType = this.renderQueueType;
9419
- decrementMaskQueue.clear();
9420
9442
  var camera = context.camera;
9421
9443
  var engine = camera.engine;
9422
9444
  camera.scene._maskManager.buildMaskRenderElement(master, incrementMaskQueue, decrementMaskQueue);
@@ -9424,9 +9446,11 @@ var ContextRendererUpdateFlag;
9424
9446
  incrementMaskQueue._batch(engine._batcherManager);
9425
9447
  primitiveChunkManagerMask.uploadBuffer();
9426
9448
  incrementMaskQueue.render(context, pipelineStageTagValue, 1);
9449
+ incrementMaskQueue.clear();
9427
9450
  decrementMaskQueue._batch(engine._batcherManager);
9428
9451
  primitiveChunkManagerMask.uploadBuffer();
9429
9452
  decrementMaskQueue.render(context, pipelineStageTagValue, 2);
9453
+ decrementMaskQueue.clear();
9430
9454
  };
9431
9455
  RenderQueue.compareForOpaque = function compareForOpaque(a, b) {
9432
9456
  return a.priority - b.priority || a.distanceForSort - b.distanceForSort;
@@ -18767,6 +18791,7 @@ __decorate([
18767
18791
  * @internal
18768
18792
  */ var BasicResources = /*#__PURE__*/ function() {
18769
18793
  function BasicResources(engine) {
18794
+ this.engine = engine;
18770
18795
  // prettier-ignore
18771
18796
  var vertices = new Float32Array([
18772
18797
  -1,
@@ -18826,6 +18851,11 @@ __decorate([
18826
18851
  }
18827
18852
  }
18828
18853
  var _proto = BasicResources.prototype;
18854
+ /**
18855
+ * @internal
18856
+ */ _proto._getBlinnPhongMaterial = function _getBlinnPhongMaterial() {
18857
+ return this._blinnPhongMaterial || (this._blinnPhongMaterial = new BlinnPhongMaterial(this.engine));
18858
+ };
18829
18859
  _proto._createBlitMesh = function _createBlitMesh(engine, vertices) {
18830
18860
  var mesh = new ModelMesh(engine);
18831
18861
  mesh._addReferCount(1);
@@ -19581,12 +19611,24 @@ var AssetPromise = /*#__PURE__*/ function() {
19581
19611
  this._onCancelHandler && this._onCancelHandler();
19582
19612
  return this;
19583
19613
  };
19584
- /**
19585
- * Return a new resource Promise through the provided asset promise collection.
19586
- * The resolved of the new AssetPromise will be triggered when all the Promises in the provided set are completed.
19587
- * @param - Promise Collection
19588
- * @returns AssetPromise
19589
- */ AssetPromise.all = function all(promises) {
19614
+ AssetPromise.resolve = function resolve(value) {
19615
+ if (value === undefined) {
19616
+ return new AssetPromise(function(resolve) {
19617
+ return resolve();
19618
+ });
19619
+ } else if (_instanceof(value, AssetPromise) || _instanceof(value, Promise)) {
19620
+ return new AssetPromise(function(resolve, reject) {
19621
+ value.then(function(resolved) {
19622
+ return resolve(resolved);
19623
+ }, reject);
19624
+ });
19625
+ } else {
19626
+ return new AssetPromise(function(resolve) {
19627
+ return resolve(value);
19628
+ });
19629
+ }
19630
+ };
19631
+ AssetPromise.all = function all(values) {
19590
19632
  return new AssetPromise(function(resolve, reject, setTaskCompleteProgress) {
19591
19633
  var onComplete = function onComplete(index, resultValue) {
19592
19634
  completed++;
@@ -19597,7 +19639,7 @@ var AssetPromise = /*#__PURE__*/ function() {
19597
19639
  }
19598
19640
  };
19599
19641
  var onProgress = function onProgress(promise, index) {
19600
- if (_instanceof(promise, Promise) || _instanceof(promise, AssetPromise)) {
19642
+ if (_instanceof(promise, AssetPromise) || _instanceof(promise, Promise)) {
19601
19643
  promise.then(function(value) {
19602
19644
  onComplete(index, value);
19603
19645
  }, reject);
@@ -19607,14 +19649,14 @@ var AssetPromise = /*#__PURE__*/ function() {
19607
19649
  });
19608
19650
  }
19609
19651
  };
19610
- var count = promises.length;
19652
+ var count = Array.from(values).length;
19611
19653
  var results = new Array(count);
19612
19654
  var completed = 0;
19613
19655
  if (count === 0) {
19614
19656
  return resolve(results);
19615
19657
  }
19616
19658
  for(var i = 0; i < count; i++){
19617
- onProgress(promises[i], i);
19659
+ onProgress(values[i], i);
19618
19660
  }
19619
19661
  });
19620
19662
  };
@@ -20196,12 +20238,12 @@ var MultiExecutor = /*#__PURE__*/ function() {
20196
20238
  var obj = this._objectPool[refId];
20197
20239
  var promise;
20198
20240
  if (obj) {
20199
- promise = Promise.resolve(obj);
20241
+ promise = AssetPromise.resolve(obj);
20200
20242
  } else {
20201
20243
  var resourceConfig = this._editorResourceConfig[refId];
20202
20244
  if (!resourceConfig) {
20203
- Logger.warn("refId:" + refId + " is not find in this._editorResourceConfig.");
20204
- return Promise.resolve(null);
20245
+ Logger.warn("refId:" + refId + " is not find in this._idResourceMap.");
20246
+ return AssetPromise.resolve(null);
20205
20247
  }
20206
20248
  var url = resourceConfig.virtualPath;
20207
20249
  if (key) {
@@ -21157,16 +21199,24 @@ var Collision = function Collision() {
21157
21199
  }
21158
21200
  return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
21159
21201
  };
21202
+ var outIDX;
21203
+ var outDistance;
21204
+ var outPosition;
21205
+ var outNormal;
21160
21206
  if (hitResult != undefined) {
21161
21207
  var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
21162
- var hitShape = _this._scene.engine._physicalObjectsMap[idx];
21163
- hitResult.entity = hitShape._collider.entity;
21164
- hitResult.shape = hitShape;
21165
- hitResult.distance = distance;
21166
- hitResult.normal.copyFrom(normal);
21167
- hitResult.point.copyFrom(position);
21208
+ outIDX = idx;
21209
+ outDistance = distance;
21210
+ outPosition = position;
21211
+ outNormal = normal;
21168
21212
  });
21169
21213
  if (result) {
21214
+ var hitShape = this._scene.engine._physicalObjectsMap[outIDX];
21215
+ hitResult.entity = hitShape._collider.entity;
21216
+ hitResult.shape = hitShape;
21217
+ hitResult.distance = outDistance;
21218
+ hitResult.point.copyFrom(outPosition);
21219
+ hitResult.normal.copyFrom(outNormal);
21170
21220
  return true;
21171
21221
  } else {
21172
21222
  hitResult.entity = null;
@@ -23890,21 +23940,15 @@ ShaderPool.init();
23890
23940
  var _this_xrManager;
23891
23941
  this._sceneManager._destroyAllScene();
23892
23942
  this._resourceManager._destroy();
23893
- this._textDefaultFont = null;
23894
- this._fontMap = null;
23895
23943
  this.inputManager._destroy();
23896
23944
  this._batcherManager.destroy();
23897
23945
  (_this_xrManager = this.xrManager) == null ? void 0 : _this_xrManager._destroy();
23898
23946
  this.dispatch("shutdown", this);
23899
23947
  // Cancel animation
23900
23948
  this.pause();
23949
+ Shader._clear(this);
23901
23950
  this._hardwareRenderer.destroy();
23902
23951
  this.removeAllEventListeners();
23903
- this._animate = null;
23904
- this._sceneManager = null;
23905
- this._resourceManager = null;
23906
- this._canvas = null;
23907
- this._time = null;
23908
23952
  this._waitingDestroy = false;
23909
23953
  this._destroyed = true;
23910
23954
  };
@@ -24072,6 +24116,7 @@ ShaderPool.init();
24072
24116
  this._hardwareRenderer.resetState();
24073
24117
  this._lastRenderState = new RenderState();
24074
24118
  // Clear shader pools
24119
+ Shader._clear(this);
24075
24120
  this._shaderProgramPools.length = 0;
24076
24121
  var resourceManager = this.resourceManager;
24077
24122
  // Restore graphic resources
@@ -27191,11 +27236,13 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
27191
27236
  * @param time - The time to sample an animation
27192
27237
  */ _proto._sampleAnimation = function _sampleAnimation(entity, time) {
27193
27238
  var _this = this, curveBindings = _this._curveBindings;
27239
+ var components = AnimationCurveOwner._components;
27194
27240
  for(var i = curveBindings.length - 1; i >= 0; i--){
27195
27241
  var curve = curveBindings[i];
27196
27242
  var targetEntity = entity.findByPath(curve.relativePath);
27197
27243
  if (targetEntity) {
27198
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27244
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27245
+ components.length = 0;
27199
27246
  if (!component) {
27200
27247
  continue;
27201
27248
  }
@@ -28810,13 +28857,15 @@ exports.AnimatorLayerBlendingMode = void 0;
28810
28857
  var curveLayerOwner = animatorStateData.curveLayerOwner;
28811
28858
  var _animatorState_clip = animatorState.clip, curves = _animatorState_clip._curveBindings;
28812
28859
  var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
28860
+ var components = AnimationCurveOwner._components;
28813
28861
  for(var i = curves.length - 1; i >= 0; i--){
28814
28862
  var curve = curves[i];
28815
28863
  var relativePath = curve.relativePath;
28816
28864
  var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
28817
28865
  if (targetEntity) {
28818
28866
  var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
28819
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28867
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28868
+ components.length = 0;
28820
28869
  if (!component) {
28821
28870
  continue;
28822
28871
  }
package/dist/module.js CHANGED
@@ -4069,6 +4069,28 @@ __decorate([
4069
4069
  */ Shader.find = function find(name) {
4070
4070
  return Shader._shaderMap[name];
4071
4071
  };
4072
+ /**
4073
+ * @internal
4074
+ */ Shader._clear = function _clear(engine) {
4075
+ var shaderMap = Shader._shaderMap;
4076
+ for(var key in shaderMap){
4077
+ var shader = shaderMap[key];
4078
+ var subShaders = shader._subShaders;
4079
+ for(var i = 0, n = subShaders.length; i < n; i++){
4080
+ var passes = subShaders[i].passes;
4081
+ for(var j = 0, m = passes.length; j < m; j++){
4082
+ var pass = passes[j];
4083
+ var passShaderProgramPools = pass._shaderProgramPools;
4084
+ for(var k = passShaderProgramPools.length - 1; k >= 0; k--){
4085
+ var shaderProgramPool = passShaderProgramPools[k];
4086
+ if (shaderProgramPool.engine !== engine) continue;
4087
+ shaderProgramPool._destroy();
4088
+ passShaderProgramPools.splice(k, 1);
4089
+ }
4090
+ }
4091
+ }
4092
+ }
4093
+ };
4072
4094
  Shader._applyConstRenderStates = function _applyConstRenderStates(renderState, key, value) {
4073
4095
  switch(key){
4074
4096
  case RenderStateElementKey.BlendStateEnabled0:
@@ -8312,6 +8334,7 @@ var /**
8312
8334
  program.uploadUnGroupTextures();
8313
8335
  (pass._renderState || blitMaterial.renderState)._applyStates(engine, false, pass._renderStateDataMap, blitMaterial.shaderData);
8314
8336
  rhi.drawPrimitive(blitMesh._primitive, blitMesh.subMesh, program);
8337
+ rendererShaderData.setTexture(PipelineUtils._blitTextureProperty, null);
8315
8338
  };
8316
8339
  return PipelineUtils;
8317
8340
  }();
@@ -8659,6 +8682,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
8659
8682
  }
8660
8683
  this._renderPipeline.render(context, cubeFace, mipLevel, ignoreClearFlags);
8661
8684
  engine._renderCount++;
8685
+ context.camera = null;
8662
8686
  };
8663
8687
  _proto.setReplacementShader = function setReplacementShader(shader, replacementTag, failureStrategy) {
8664
8688
  if (failureStrategy === void 0) failureStrategy = ReplacementFailureStrategy.KeepOriginalShader;
@@ -9408,10 +9432,8 @@ var ContextRendererUpdateFlag;
9408
9432
  _proto._drawMask = function _drawMask(context, pipelineStageTagValue, master) {
9409
9433
  var incrementMaskQueue = MaskManager.getMaskIncrementRenderQueue();
9410
9434
  incrementMaskQueue.renderQueueType = this.renderQueueType;
9411
- incrementMaskQueue.clear();
9412
9435
  var decrementMaskQueue = MaskManager.getMaskDecrementRenderQueue();
9413
9436
  decrementMaskQueue.renderQueueType = this.renderQueueType;
9414
- decrementMaskQueue.clear();
9415
9437
  var camera = context.camera;
9416
9438
  var engine = camera.engine;
9417
9439
  camera.scene._maskManager.buildMaskRenderElement(master, incrementMaskQueue, decrementMaskQueue);
@@ -9419,9 +9441,11 @@ var ContextRendererUpdateFlag;
9419
9441
  incrementMaskQueue._batch(engine._batcherManager);
9420
9442
  primitiveChunkManagerMask.uploadBuffer();
9421
9443
  incrementMaskQueue.render(context, pipelineStageTagValue, 1);
9444
+ incrementMaskQueue.clear();
9422
9445
  decrementMaskQueue._batch(engine._batcherManager);
9423
9446
  primitiveChunkManagerMask.uploadBuffer();
9424
9447
  decrementMaskQueue.render(context, pipelineStageTagValue, 2);
9448
+ decrementMaskQueue.clear();
9425
9449
  };
9426
9450
  RenderQueue.compareForOpaque = function compareForOpaque(a, b) {
9427
9451
  return a.priority - b.priority || a.distanceForSort - b.distanceForSort;
@@ -18762,6 +18786,7 @@ __decorate([
18762
18786
  * @internal
18763
18787
  */ var BasicResources = /*#__PURE__*/ function() {
18764
18788
  function BasicResources(engine) {
18789
+ this.engine = engine;
18765
18790
  // prettier-ignore
18766
18791
  var vertices = new Float32Array([
18767
18792
  -1,
@@ -18821,6 +18846,11 @@ __decorate([
18821
18846
  }
18822
18847
  }
18823
18848
  var _proto = BasicResources.prototype;
18849
+ /**
18850
+ * @internal
18851
+ */ _proto._getBlinnPhongMaterial = function _getBlinnPhongMaterial() {
18852
+ return this._blinnPhongMaterial || (this._blinnPhongMaterial = new BlinnPhongMaterial(this.engine));
18853
+ };
18824
18854
  _proto._createBlitMesh = function _createBlitMesh(engine, vertices) {
18825
18855
  var mesh = new ModelMesh(engine);
18826
18856
  mesh._addReferCount(1);
@@ -19576,12 +19606,24 @@ var AssetPromise = /*#__PURE__*/ function() {
19576
19606
  this._onCancelHandler && this._onCancelHandler();
19577
19607
  return this;
19578
19608
  };
19579
- /**
19580
- * Return a new resource Promise through the provided asset promise collection.
19581
- * The resolved of the new AssetPromise will be triggered when all the Promises in the provided set are completed.
19582
- * @param - Promise Collection
19583
- * @returns AssetPromise
19584
- */ AssetPromise.all = function all(promises) {
19609
+ AssetPromise.resolve = function resolve(value) {
19610
+ if (value === undefined) {
19611
+ return new AssetPromise(function(resolve) {
19612
+ return resolve();
19613
+ });
19614
+ } else if (_instanceof(value, AssetPromise) || _instanceof(value, Promise)) {
19615
+ return new AssetPromise(function(resolve, reject) {
19616
+ value.then(function(resolved) {
19617
+ return resolve(resolved);
19618
+ }, reject);
19619
+ });
19620
+ } else {
19621
+ return new AssetPromise(function(resolve) {
19622
+ return resolve(value);
19623
+ });
19624
+ }
19625
+ };
19626
+ AssetPromise.all = function all(values) {
19585
19627
  return new AssetPromise(function(resolve, reject, setTaskCompleteProgress) {
19586
19628
  var onComplete = function onComplete(index, resultValue) {
19587
19629
  completed++;
@@ -19592,7 +19634,7 @@ var AssetPromise = /*#__PURE__*/ function() {
19592
19634
  }
19593
19635
  };
19594
19636
  var onProgress = function onProgress(promise, index) {
19595
- if (_instanceof(promise, Promise) || _instanceof(promise, AssetPromise)) {
19637
+ if (_instanceof(promise, AssetPromise) || _instanceof(promise, Promise)) {
19596
19638
  promise.then(function(value) {
19597
19639
  onComplete(index, value);
19598
19640
  }, reject);
@@ -19602,14 +19644,14 @@ var AssetPromise = /*#__PURE__*/ function() {
19602
19644
  });
19603
19645
  }
19604
19646
  };
19605
- var count = promises.length;
19647
+ var count = Array.from(values).length;
19606
19648
  var results = new Array(count);
19607
19649
  var completed = 0;
19608
19650
  if (count === 0) {
19609
19651
  return resolve(results);
19610
19652
  }
19611
19653
  for(var i = 0; i < count; i++){
19612
- onProgress(promises[i], i);
19654
+ onProgress(values[i], i);
19613
19655
  }
19614
19656
  });
19615
19657
  };
@@ -20191,12 +20233,12 @@ var MultiExecutor = /*#__PURE__*/ function() {
20191
20233
  var obj = this._objectPool[refId];
20192
20234
  var promise;
20193
20235
  if (obj) {
20194
- promise = Promise.resolve(obj);
20236
+ promise = AssetPromise.resolve(obj);
20195
20237
  } else {
20196
20238
  var resourceConfig = this._editorResourceConfig[refId];
20197
20239
  if (!resourceConfig) {
20198
- Logger.warn("refId:" + refId + " is not find in this._editorResourceConfig.");
20199
- return Promise.resolve(null);
20240
+ Logger.warn("refId:" + refId + " is not find in this._idResourceMap.");
20241
+ return AssetPromise.resolve(null);
20200
20242
  }
20201
20243
  var url = resourceConfig.virtualPath;
20202
20244
  if (key) {
@@ -21152,16 +21194,24 @@ var Collision = function Collision() {
21152
21194
  }
21153
21195
  return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
21154
21196
  };
21197
+ var outIDX;
21198
+ var outDistance;
21199
+ var outPosition;
21200
+ var outNormal;
21155
21201
  if (hitResult != undefined) {
21156
21202
  var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
21157
- var hitShape = _this._scene.engine._physicalObjectsMap[idx];
21158
- hitResult.entity = hitShape._collider.entity;
21159
- hitResult.shape = hitShape;
21160
- hitResult.distance = distance;
21161
- hitResult.normal.copyFrom(normal);
21162
- hitResult.point.copyFrom(position);
21203
+ outIDX = idx;
21204
+ outDistance = distance;
21205
+ outPosition = position;
21206
+ outNormal = normal;
21163
21207
  });
21164
21208
  if (result) {
21209
+ var hitShape = this._scene.engine._physicalObjectsMap[outIDX];
21210
+ hitResult.entity = hitShape._collider.entity;
21211
+ hitResult.shape = hitShape;
21212
+ hitResult.distance = outDistance;
21213
+ hitResult.point.copyFrom(outPosition);
21214
+ hitResult.normal.copyFrom(outNormal);
21165
21215
  return true;
21166
21216
  } else {
21167
21217
  hitResult.entity = null;
@@ -23885,21 +23935,15 @@ ShaderPool.init();
23885
23935
  var _this_xrManager;
23886
23936
  this._sceneManager._destroyAllScene();
23887
23937
  this._resourceManager._destroy();
23888
- this._textDefaultFont = null;
23889
- this._fontMap = null;
23890
23938
  this.inputManager._destroy();
23891
23939
  this._batcherManager.destroy();
23892
23940
  (_this_xrManager = this.xrManager) == null ? void 0 : _this_xrManager._destroy();
23893
23941
  this.dispatch("shutdown", this);
23894
23942
  // Cancel animation
23895
23943
  this.pause();
23944
+ Shader._clear(this);
23896
23945
  this._hardwareRenderer.destroy();
23897
23946
  this.removeAllEventListeners();
23898
- this._animate = null;
23899
- this._sceneManager = null;
23900
- this._resourceManager = null;
23901
- this._canvas = null;
23902
- this._time = null;
23903
23947
  this._waitingDestroy = false;
23904
23948
  this._destroyed = true;
23905
23949
  };
@@ -24067,6 +24111,7 @@ ShaderPool.init();
24067
24111
  this._hardwareRenderer.resetState();
24068
24112
  this._lastRenderState = new RenderState();
24069
24113
  // Clear shader pools
24114
+ Shader._clear(this);
24070
24115
  this._shaderProgramPools.length = 0;
24071
24116
  var resourceManager = this.resourceManager;
24072
24117
  // Restore graphic resources
@@ -27186,11 +27231,13 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
27186
27231
  * @param time - The time to sample an animation
27187
27232
  */ _proto._sampleAnimation = function _sampleAnimation(entity, time) {
27188
27233
  var _this = this, curveBindings = _this._curveBindings;
27234
+ var components = AnimationCurveOwner._components;
27189
27235
  for(var i = curveBindings.length - 1; i >= 0; i--){
27190
27236
  var curve = curveBindings[i];
27191
27237
  var targetEntity = entity.findByPath(curve.relativePath);
27192
27238
  if (targetEntity) {
27193
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27239
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27240
+ components.length = 0;
27194
27241
  if (!component) {
27195
27242
  continue;
27196
27243
  }
@@ -28805,13 +28852,15 @@ var AnimatorLayerBlendingMode;
28805
28852
  var curveLayerOwner = animatorStateData.curveLayerOwner;
28806
28853
  var _animatorState_clip = animatorState.clip, curves = _animatorState_clip._curveBindings;
28807
28854
  var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
28855
+ var components = AnimationCurveOwner._components;
28808
28856
  for(var i = curves.length - 1; i >= 0; i--){
28809
28857
  var curve = curves[i];
28810
28858
  var relativePath = curve.relativePath;
28811
28859
  var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
28812
28860
  if (targetEntity) {
28813
28861
  var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
28814
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28862
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28863
+ components.length = 0;
28815
28864
  if (!component) {
28816
28865
  continue;
28817
28866
  }