@galacean/engine 1.3.12 → 1.3.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.
package/dist/browser.js CHANGED
@@ -4518,7 +4518,7 @@
4518
4518
  out._r = Color.gammaToLinearSpace(this._r);
4519
4519
  out._g = Color.gammaToLinearSpace(this._g);
4520
4520
  out._b = Color.gammaToLinearSpace(this._b);
4521
- this._onValueChanged && this._onValueChanged();
4521
+ out._onValueChanged && out._onValueChanged();
4522
4522
  return out;
4523
4523
  };
4524
4524
  /**
@@ -4529,7 +4529,7 @@
4529
4529
  out._r = Color.linearToGammaSpace(this._r);
4530
4530
  out._g = Color.linearToGammaSpace(this._g);
4531
4531
  out._b = Color.linearToGammaSpace(this._b);
4532
- this._onValueChanged && this._onValueChanged();
4532
+ out._onValueChanged && out._onValueChanged();
4533
4533
  return out;
4534
4534
  };
4535
4535
  /**
@@ -8059,8 +8059,11 @@
8059
8059
  */ _proto._destroy = function _destroy() {
8060
8060
  var shaderProgramPools = this._shaderProgramPools;
8061
8061
  for(var i = 0, n = shaderProgramPools.length; i < n; i++){
8062
- shaderProgramPools[i]._destroy();
8062
+ var shaderProgramPool = shaderProgramPools[i];
8063
+ shaderProgramPool._destroy();
8064
+ delete shaderProgramPool.engine._shaderProgramPools[this._shaderPassId];
8063
8065
  }
8066
+ // Clear array storing multiple engine shader program pools
8064
8067
  shaderProgramPools.length = 0;
8065
8068
  };
8066
8069
  /**
@@ -27838,7 +27841,8 @@
27838
27841
  * Shader program pool.
27839
27842
  * @internal
27840
27843
  */ var ShaderProgramPool = /*#__PURE__*/ function() {
27841
- var ShaderProgramPool = function ShaderProgramPool() {
27844
+ var ShaderProgramPool = function ShaderProgramPool(engine) {
27845
+ this.engine = engine;
27842
27846
  this._cacheHierarchyDepth = 1;
27843
27847
  this._cacheMap = Object.create(null);
27844
27848
  };
@@ -28240,7 +28244,7 @@
28240
28244
  if (length > shaderProgramPools.length) {
28241
28245
  shaderProgramPools.length = length;
28242
28246
  }
28243
- shaderProgramPools[index] = pool = new ShaderProgramPool();
28247
+ shaderProgramPools[index] = pool = new ShaderProgramPool(this);
28244
28248
  shaderPass._shaderProgramPools.push(pool);
28245
28249
  }
28246
28250
  return pool;
@@ -30892,17 +30896,16 @@
30892
30896
  * @internal
30893
30897
  */ _proto._onDisableInScene = function _onDisableInScene() {
30894
30898
  var componentsManager = this.scene._componentsManager;
30895
- var prototype = Script.prototype;
30896
30899
  if (!this._started) {
30897
30900
  componentsManager.removeOnStartScript(this);
30898
30901
  }
30899
- if (this.onUpdate !== prototype.onUpdate) {
30902
+ if (this._onUpdateIndex >= 0) {
30900
30903
  componentsManager.removeOnUpdateScript(this);
30901
30904
  }
30902
- if (this.onLateUpdate !== prototype.onLateUpdate) {
30905
+ if (this._onLateUpdateIndex >= 0) {
30903
30906
  componentsManager.removeOnLateUpdateScript(this);
30904
30907
  }
30905
- if (this.onPhysicsUpdate !== prototype.onPhysicsUpdate) {
30908
+ if (this._onPhysicsUpdateIndex >= 0) {
30906
30909
  componentsManager.removeOnPhysicsUpdateScript(this);
30907
30910
  }
30908
30911
  this._entity._removeScript(this);
@@ -33225,8 +33228,9 @@
33225
33228
  eventHandler.event = event;
33226
33229
  handlers.length = 0;
33227
33230
  for(var j = scriptCount - 1; j >= 0; j--){
33231
+ var _script_funcName;
33228
33232
  var script = scripts[j];
33229
- var handler = script[funcName].bind(script);
33233
+ var handler = (_script_funcName = script[funcName]) == null ? void 0 : _script_funcName.bind(script);
33230
33234
  handler && handlers.push(handler);
33231
33235
  }
33232
33236
  eventHandlers.push(eventHandler);
@@ -48146,7 +48150,7 @@
48146
48150
  ], EXT_texture_webp);
48147
48151
 
48148
48152
  //@ts-ignore
48149
- var version = "1.3.12";
48153
+ var version = "1.3.14";
48150
48154
  console.log("Galacean engine version: " + version);
48151
48155
  for(var key in CoreObjects){
48152
48156
  Loader.registerClass(key, CoreObjects[key]);