@galacean/engine 1.2.0-alpha.4 → 1.2.0-alpha.8

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
@@ -8288,7 +8288,7 @@
8288
8288
  Logger.error('Shader slice "' + match.trim() + '" not founded.');
8289
8289
  return "";
8290
8290
  }
8291
- return ShaderFactory.parseIncludes(replace);
8291
+ return ShaderFactory.parseIncludes(replace, regex);
8292
8292
  };
8293
8293
  return src.replace(regex, replace);
8294
8294
  };
@@ -24296,8 +24296,8 @@
24296
24296
  set: function set(value) {
24297
24297
  if (this._width !== value) {
24298
24298
  this._width = value;
24299
+ this._onWidthChanged(value);
24299
24300
  this._sizeUpdateFlagManager.dispatch();
24300
- this._onSizeChanged(value, this._width);
24301
24301
  }
24302
24302
  }
24303
24303
  },
@@ -24311,8 +24311,8 @@
24311
24311
  set: function set(value) {
24312
24312
  if (this._height !== value) {
24313
24313
  this._height = value;
24314
+ this._onHeightChange(value);
24314
24315
  this._sizeUpdateFlagManager.dispatch();
24315
- this._onSizeChanged(this._width, value);
24316
24316
  }
24317
24317
  }
24318
24318
  }
@@ -34549,7 +34549,8 @@
34549
34549
  var transform = this._renderer.entity.transform;
34550
34550
  var shape = this.emission.shape;
34551
34551
  for(var i = 0; i < count; i++){
34552
- if (shape) {
34552
+ var _shape;
34553
+ if ((_shape = shape) == null ? void 0 : _shape.enabled) {
34553
34554
  shape._generatePositionAndDirection(this.emission._shapeRand, time, position, direction);
34554
34555
  var positionScale = this.main._getPositionScale();
34555
34556
  position.multiply(positionScale);
@@ -35126,7 +35127,7 @@
35126
35127
  * Base class for all particle shapes.
35127
35128
  */ var BaseShape = /*#__PURE__*/ function() {
35128
35129
  var BaseShape = function BaseShape() {
35129
- /** Specifies whether the ShapeModule is enabled or disabled. */ this.enable = true;
35130
+ /** Specifies whether the ShapeModule is enabled or disabled. */ this.enabled = true;
35130
35131
  /** Randomizes the starting direction of particles. */ this.randomDirectionAmount = 0;
35131
35132
  };
35132
35133
  var _proto = BaseShape.prototype;
@@ -36100,8 +36101,10 @@
36100
36101
  if (pixelRatio === void 0) pixelRatio = window.devicePixelRatio;
36101
36102
  var webCanvas = this._webCanvas;
36102
36103
  if (typeof OffscreenCanvas === "undefined" || !_instanceof1$1(webCanvas, OffscreenCanvas)) {
36103
- this.width = webCanvas.clientWidth * pixelRatio;
36104
- this.height = webCanvas.clientHeight * pixelRatio;
36104
+ var exportWidth = webCanvas.clientWidth * pixelRatio;
36105
+ var exportHeight = webCanvas.clientHeight * pixelRatio;
36106
+ this.width = exportWidth;
36107
+ this.height = exportHeight;
36105
36108
  }
36106
36109
  };
36107
36110
  /**
@@ -36112,9 +36115,11 @@
36112
36115
  this._scale.set(x, y);
36113
36116
  this.scale = this._scale;
36114
36117
  };
36115
- _proto._onSizeChanged = function _onSizeChanged(width, height) {
36116
- this._webCanvas.width = width;
36117
- this._webCanvas.height = height;
36118
+ _proto._onWidthChanged = function _onWidthChanged(value) {
36119
+ this._webCanvas.width = value;
36120
+ };
36121
+ _proto._onHeightChange = function _onHeightChange(value) {
36122
+ this._webCanvas.height = value;
36118
36123
  };
36119
36124
  _create_class$1(WebCanvas, [
36120
36125
  {
@@ -38994,6 +38999,7 @@
38994
38999
  }
38995
39000
  };
38996
39001
  _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
39002
+ if (entityConfig === void 0) entityConfig = {};
38997
39003
  var _entityConfig_isActive;
38998
39004
  entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
38999
39005
  var _entityConfig_name;
@@ -39006,12 +39012,18 @@
39006
39012
  };
39007
39013
  _proto._traverseAddEntityToMap = function _traverseAddEntityToMap(entity, context, path) {
39008
39014
  var entityMap = context.entityMap, components = context.components;
39015
+ var componentsMap = {};
39016
+ var componentIndexMap = {};
39009
39017
  entityMap.set(path, entity);
39010
39018
  // @ts-ignore
39011
39019
  entity._components.forEach(function(component) {
39012
39020
  // @ts-ignore
39013
39021
  var name = Loader.getClassName(component.constructor);
39014
- components.set(path + ":" + name, component);
39022
+ if (!componentsMap[name]) {
39023
+ componentsMap[name] = entity.getComponents(component.constructor, []);
39024
+ componentIndexMap[name] = 0;
39025
+ }
39026
+ components.set(path + ":" + name + "/" + componentIndexMap[name]++, component);
39015
39027
  });
39016
39028
  for(var i = 0; i < entity.children.length; i++){
39017
39029
  var child = entity.children[i];
@@ -44676,7 +44688,7 @@
44676
44688
  ], KHR_materials_anisotropy);
44677
44689
 
44678
44690
  //@ts-ignore
44679
- var version = "1.2.0-alpha.4";
44691
+ var version = "1.2.0-alpha.8";
44680
44692
  console.log("Galacean engine version: " + version);
44681
44693
  for(var key in CoreObjects){
44682
44694
  Loader.registerClass(key, CoreObjects[key]);