@galacean/engine 1.1.0-beta.18 → 1.1.0-beta.19

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
@@ -12565,6 +12565,7 @@
12565
12565
  SpriteModifyFlags[SpriteModifyFlags["region"] = 0x20] = "region";
12566
12566
  SpriteModifyFlags[SpriteModifyFlags["pivot"] = 0x40] = "pivot";
12567
12567
  SpriteModifyFlags[SpriteModifyFlags["border"] = 0x80] = "border";
12568
+ SpriteModifyFlags[SpriteModifyFlags["destroy"] = 0x100] = "destroy";
12568
12569
  })(SpriteModifyFlags || (SpriteModifyFlags = {}));
12569
12570
  /**
12570
12571
  * A component for masking Sprites.
@@ -17934,24 +17935,16 @@
17934
17935
  return subResource;
17935
17936
  };
17936
17937
  _proto._parseURL = function _parseURL(path) {
17937
- var assetBaseURL = path;
17938
- var index = assetBaseURL.indexOf("?");
17939
- if (index !== -1) {
17940
- assetBaseURL = assetBaseURL.slice(0, index);
17941
- }
17938
+ var _path_split = path.split("?"), baseUrl = _path_split[0], searchStr = _path_split[1];
17939
+ var searchParams = new URLSearchParams(searchStr);
17940
+ var queryPath = searchParams.get("q");
17941
+ searchParams.delete("q");
17942
+ var assetBaseURL = searchParams.size > 0 ? baseUrl + "?" + searchParams.toString() : baseUrl;
17942
17943
  return {
17943
17944
  assetBaseURL: assetBaseURL,
17944
- queryPath: this._getParameterByName("q", path)
17945
+ queryPath: queryPath
17945
17946
  };
17946
17947
  };
17947
- _proto._getParameterByName = function _getParameterByName(name1, url) {
17948
- if (url === void 0) url = window.location.href;
17949
- name1 = name1.replace(/[\[\]]/g, "\\$&");
17950
- var regex = new RegExp("[?&]" + name1 + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
17951
- if (!results) return null;
17952
- if (!results[2]) return "";
17953
- return decodeURIComponent(results[2].replace(/\+/g, " "));
17954
- };
17955
17948
  _proto._parseQueryPath = function _parseQueryPath(string) {
17956
17949
  var result = [];
17957
17950
  if (string.charCodeAt(0) === charCodeOfDot) {
@@ -21546,6 +21539,7 @@
21546
21539
  /**
21547
21540
  * @internal
21548
21541
  */ _proto._onDestroy = function _onDestroy() {
21542
+ this._dispatchSpriteChange(SpriteModifyFlags.destroy);
21549
21543
  ReferResource1.prototype._onDestroy.call(this);
21550
21544
  this._positions.length = 0;
21551
21545
  this._positions = null;
@@ -22493,6 +22487,9 @@
22493
22487
  case SpriteModifyFlags.pivot:
22494
22488
  this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
22495
22489
  break;
22490
+ case SpriteModifyFlags.destroy:
22491
+ this.sprite = null;
22492
+ break;
22496
22493
  }
22497
22494
  };
22498
22495
  _create_class$3(SpriteRenderer, [
@@ -33712,7 +33709,7 @@
33712
33709
  var _this = this, main = _this.main, emission = _this.emission;
33713
33710
  var duration = main.duration;
33714
33711
  var lastPlayTime = this._playTime;
33715
- this._playTime += elapsedTime;
33712
+ this._playTime += elapsedTime * main.simulationSpeed;
33716
33713
  this._retireActiveParticles();
33717
33714
  this._freeRetiredParticles();
33718
33715
  if (emission.enabled && this._isPlaying) {
@@ -37888,11 +37885,17 @@
37888
37885
  });
37889
37886
  };
37890
37887
  _proto.parseClassObject = function parseClassObject(item) {
37888
+ var _this = this;
37891
37889
  var Class = Loader.getClass(item.class);
37892
37890
  var _item_constructParams;
37893
37891
  var params = (_item_constructParams = item.constructParams) != null ? _item_constructParams : [];
37894
- var instance = _construct(Class, [].concat(params));
37895
- return this.parsePropsAndMethods(instance, item);
37892
+ return Promise.all(params.map(function(param) {
37893
+ return _this.parseBasicType(param);
37894
+ })).then(function(resultParams) {
37895
+ return _construct(Class, [].concat(resultParams));
37896
+ }).then(function(instance) {
37897
+ return _this.parsePropsAndMethods(instance, item);
37898
+ });
37896
37899
  };
37897
37900
  _proto.parsePropsAndMethods = function parsePropsAndMethods(instance, item) {
37898
37901
  var promises = [];
@@ -37900,16 +37903,14 @@
37900
37903
  for(var methodName in item.methods){
37901
37904
  var methodParams = item.methods[methodName];
37902
37905
  for(var i = 0, count = methodParams.length; i < count; i++){
37903
- var params = methodParams[i];
37904
- var promise = this.parseMethod(instance, methodName, params);
37905
- promises.push(promise);
37906
+ promises.push(this.parseMethod(instance, methodName, methodParams[i]));
37906
37907
  }
37907
37908
  }
37908
37909
  }
37909
37910
  if (item.props) {
37910
37911
  var _this = this, _loop = function _loop(key) {
37911
37912
  var value = item.props[key];
37912
- var promise = _this.parseBasicType(value).then(function(v) {
37913
+ var promise = _this.parseBasicType(value, instance[key]).then(function(v) {
37913
37914
  return instance[key] = v;
37914
37915
  });
37915
37916
  promises.push(promise);
@@ -37931,7 +37932,7 @@
37931
37932
  return (_instance = instance)[methodName].apply(_instance, [].concat(result));
37932
37933
  });
37933
37934
  };
37934
- _proto.parseBasicType = function parseBasicType(value) {
37935
+ _proto.parseBasicType = function parseBasicType(value, originValue) {
37935
37936
  var _this = this;
37936
37937
  if (Array.isArray(value)) {
37937
37938
  return Promise.all(value.map(function(item) {
@@ -37948,13 +37949,33 @@
37948
37949
  } else if (ReflectionParser._isEntityRef(value)) {
37949
37950
  // entity reference
37950
37951
  return Promise.resolve(this._context.entityMap.get(value.entityId));
37951
- } else {
37952
- // basic type
37953
- return Promise.resolve(value);
37952
+ } else if (originValue) {
37953
+ var _this1 = this, _loop = function _loop(key) {
37954
+ if (key === "methods") {
37955
+ var methods = value[key];
37956
+ for(var methodName in methods){
37957
+ var methodParams = methods[methodName];
37958
+ for(var i = 0, count = methodParams.length; i < count; i++){
37959
+ var params = methodParams[i];
37960
+ var promise = _this1.parseMethod(originValue, methodName, params);
37961
+ promises.push(promise);
37962
+ }
37963
+ }
37964
+ } else {
37965
+ promises.push(_this1.parseBasicType(value[key], originValue[key]).then(function(v) {
37966
+ return originValue[key] = v;
37967
+ }));
37968
+ }
37969
+ };
37970
+ var promises = [];
37971
+ for(var key in value)_loop(key);
37972
+ return Promise.all(promises).then(function() {
37973
+ return originValue;
37974
+ });
37954
37975
  }
37955
- } else {
37956
- return Promise.resolve(value);
37957
37976
  }
37977
+ // primitive type
37978
+ return Promise.resolve(value);
37958
37979
  };
37959
37980
  _proto._getEntityByConfig = function _getEntityByConfig(entityConfig) {
37960
37981
  // @ts-ignore
@@ -43386,7 +43407,7 @@
43386
43407
  ], GALACEAN_animation_event);
43387
43408
 
43388
43409
  //@ts-ignore
43389
- var version = "1.1.0-beta.18";
43410
+ var version = "1.1.0-beta.19";
43390
43411
  console.log("Galacean engine version: " + version);
43391
43412
  for(var key in CoreObjects){
43392
43413
  Loader.registerClass(key, CoreObjects[key]);