@galacean/engine 1.1.0-beta.25 → 1.1.0-beta.28

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/.DS_Store ADDED
Binary file
package/dist/browser.js CHANGED
@@ -21067,6 +21067,8 @@
21067
21067
  _this = ReferResource1.call(this, engine) || this;
21068
21068
  /** @internal */ _this._renderStates = [] // todo: later will as a part of shaderData when shader effect frame is OK, that is more powerful and flexible.
21069
21069
  ;
21070
+ /** @internal */ _this._priority = 0 // todo: temporary resolution of submesh rendering order issue.
21071
+ ;
21070
21072
  _this._shaderData = new ShaderData(ShaderDataGroup.Material);
21071
21073
  _this.shader = shader;
21072
21074
  return _this;
@@ -26302,12 +26304,12 @@
26302
26304
  /**
26303
26305
  * @internal
26304
26306
  */ RenderQueue._compareFromNearToFar = function _compareFromNearToFar(a, b) {
26305
- return a.data.component.priority - b.data.component.priority || a.data.component._distanceForSort - b.data.component._distanceForSort;
26307
+ return a.data.component.priority - b.data.component.priority || a.data.material._priority - b.data.material._priority || a.data.component._distanceForSort - b.data.component._distanceForSort;
26306
26308
  };
26307
26309
  /**
26308
26310
  * @internal
26309
26311
  */ RenderQueue._compareFromFarToNear = function _compareFromFarToNear(a, b) {
26310
- return a.data.component.priority - b.data.component.priority || b.data.component._distanceForSort - a.data.component._distanceForSort;
26312
+ return a.data.component.priority - b.data.component.priority || a.data.material._priority - b.data.material._priority || b.data.component._distanceForSort - a.data.component._distanceForSort;
26311
26313
  };
26312
26314
  return RenderQueue;
26313
26315
  }();
@@ -29466,6 +29468,7 @@
29466
29468
  _this = EngineObject1.call(this, null) || this;
29467
29469
  _this.name = name1;
29468
29470
  _this./** @internal */ _curveBindings = [];
29471
+ _this./** @internal */ _updateFlagManager = new UpdateFlagManager();
29469
29472
  _this._length = 0;
29470
29473
  _this._events = [];
29471
29474
  return _this;
@@ -29494,11 +29497,13 @@
29494
29497
  while(--index >= 0 && eventTime < events[index].time);
29495
29498
  events.splice(index + 1, 0, newEvent);
29496
29499
  }
29500
+ this._updateFlagManager.dispatch();
29497
29501
  };
29498
29502
  /**
29499
29503
  * Clears all events from the clip.
29500
29504
  */ _proto.clearEvents = function clearEvents() {
29501
29505
  this._events.length = 0;
29506
+ this._updateFlagManager.dispatch();
29502
29507
  };
29503
29508
  /**
29504
29509
  * Add curve binding for the clip.
@@ -30955,26 +30960,31 @@
30955
30960
  }
30956
30961
  };
30957
30962
  _proto._saveAnimatorEventHandlers = function _saveAnimatorEventHandlers(state, animatorStateData) {
30963
+ var _this = this;
30958
30964
  var eventHandlerPool = this._animationEventHandlerPool;
30959
30965
  var scripts = [];
30960
- this._entity.getComponents(Script, scripts);
30961
- var scriptCount = scripts.length;
30962
30966
  var eventHandlers = animatorStateData.eventHandlers;
30963
- var events = state.clip.events;
30964
- eventHandlers.length = 0;
30965
- for(var i = 0, n = events.length; i < n; i++){
30966
- var event = events[i];
30967
- var eventHandler = eventHandlerPool.getFromPool();
30968
- var funcName = event.functionName;
30969
- var handlers = eventHandler.handlers;
30970
- eventHandler.event = event;
30971
- handlers.length = 0;
30972
- for(var j = scriptCount - 1; j >= 0; j--){
30973
- var handler = scripts[j][funcName];
30974
- handler && handlers.push(handler);
30967
+ var clipChangedListener = function clipChangedListener() {
30968
+ _this._entity.getComponents(Script, scripts);
30969
+ var scriptCount = scripts.length;
30970
+ var events = state.clip.events;
30971
+ eventHandlers.length = 0;
30972
+ for(var i = 0, n = events.length; i < n; i++){
30973
+ var event = events[i];
30974
+ var eventHandler = eventHandlerPool.getFromPool();
30975
+ var funcName = event.functionName;
30976
+ var handlers = eventHandler.handlers;
30977
+ eventHandler.event = event;
30978
+ handlers.length = 0;
30979
+ for(var j = scriptCount - 1; j >= 0; j--){
30980
+ var handler = scripts[j][funcName];
30981
+ handler && handlers.push(handler);
30982
+ }
30983
+ eventHandlers.push(eventHandler);
30975
30984
  }
30976
- eventHandlers.push(eventHandler);
30977
- }
30985
+ };
30986
+ clipChangedListener();
30987
+ state._updateFlagManager.addListener(clipChangedListener);
30978
30988
  };
30979
30989
  _proto._clearCrossData = function _clearCrossData(animatorLayerData) {
30980
30990
  animatorLayerData.crossCurveMark++;
@@ -31581,9 +31591,11 @@
31581
31591
  this./** @internal */ _onStateEnterScripts = [];
31582
31592
  this./** @internal */ _onStateUpdateScripts = [];
31583
31593
  this./** @internal */ _onStateExitScripts = [];
31594
+ this./** @internal */ _updateFlagManager = new UpdateFlagManager();
31584
31595
  this._clipStartTime = 0;
31585
31596
  this._clipEndTime = 1;
31586
31597
  this._transitions = [];
31598
+ this._onClipChanged = this._onClipChanged.bind(this);
31587
31599
  };
31588
31600
  var _proto = AnimatorState.prototype;
31589
31601
  /**
@@ -31657,6 +31669,11 @@
31657
31669
  index2 !== -1 && this._onStateExitScripts.splice(index2, 1);
31658
31670
  }
31659
31671
  };
31672
+ /**
31673
+ * @internal
31674
+ */ _proto._onClipChanged = function _onClipChanged() {
31675
+ this._updateFlagManager.dispatch();
31676
+ };
31660
31677
  _create_class$3(AnimatorState, [
31661
31678
  {
31662
31679
  key: "transitions",
@@ -31674,8 +31691,17 @@
31674
31691
  return this._clip;
31675
31692
  },
31676
31693
  set: function set(clip) {
31694
+ var lastClip = this._clip;
31695
+ if (lastClip === clip) {
31696
+ return;
31697
+ }
31698
+ if (lastClip) {
31699
+ lastClip._updateFlagManager.removeListener(this._onClipChanged);
31700
+ }
31677
31701
  this._clip = clip;
31678
31702
  this._clipEndTime = Math.min(this._clipEndTime, 1);
31703
+ this._onClipChanged();
31704
+ clip._updateFlagManager.addListener(this._onClipChanged);
31679
31705
  }
31680
31706
  },
31681
31707
  {
@@ -38057,6 +38083,8 @@
38057
38083
  if (position) entity.transform.position.copyFrom(position);
38058
38084
  if (rotation) entity.transform.rotation.copyFrom(rotation);
38059
38085
  if (scale) entity.transform.scale.copyFrom(scale);
38086
+ var _entityConfig_layer;
38087
+ entity.layer = (_entityConfig_layer = entityConfig.layer) != null ? _entityConfig_layer : entity.layer;
38060
38088
  return entity;
38061
38089
  });
38062
38090
  };
@@ -42888,9 +42916,13 @@
42888
42916
  type: "image"
42889
42917
  });
42890
42918
  _this.request(url, requestConfig).then(function(image) {
42891
- var _params, _params1;
42892
- var params = item.params;
42893
- var texture = new Texture2D(resourceManager.engine, image.width, image.height, (_params = params) == null ? void 0 : _params.format, (_params1 = params) == null ? void 0 : _params1.mipmap);
42919
+ var _item_params;
42920
+ var _ref = (_item_params = item.params) != null ? _item_params : {}, format = _ref.format, mipmap = _ref.mipmap, anisoLevel = _ref.anisoLevel, wrapModeU = _ref.wrapModeU, wrapModeV = _ref.wrapModeV, filterMode = _ref.filterMode;
42921
+ var texture = new Texture2D(resourceManager.engine, image.width, image.height, format, mipmap);
42922
+ texture.anisoLevel = anisoLevel != null ? anisoLevel : texture.anisoLevel;
42923
+ texture.filterMode = filterMode != null ? filterMode : texture.filterMode;
42924
+ texture.wrapModeU = wrapModeU != null ? wrapModeU : texture.wrapModeU;
42925
+ texture.wrapModeV = wrapModeV != null ? wrapModeV : texture.wrapModeV;
42894
42926
  texture.setImageSource(image);
42895
42927
  texture.generateMipmaps();
42896
42928
  if (url.indexOf("data:") !== 0) {
@@ -43101,6 +43133,9 @@
43101
43133
  if (shadow.shadowResolution != undefined) scene.shadowResolution = shadow.shadowResolution;
43102
43134
  if (shadow.shadowDistance != undefined) scene.shadowDistance = shadow.shadowDistance;
43103
43135
  if (shadow.shadowCascades != undefined) scene.shadowCascades = shadow.shadowCascades;
43136
+ var _shadow_shadowTwoCascadeSplits;
43137
+ scene.shadowTwoCascadeSplits = (_shadow_shadowTwoCascadeSplits = shadow.shadowTwoCascadeSplits) != null ? _shadow_shadowTwoCascadeSplits : scene.shadowTwoCascadeSplits;
43138
+ shadow.shadowFourCascadeSplits && scene.shadowFourCascadeSplits.copyFrom(shadow.shadowFourCascadeSplits);
43104
43139
  }
43105
43140
  return Promise.all(promises).then(function() {
43106
43141
  resolve(scene);
@@ -43612,7 +43647,7 @@
43612
43647
  ], GALACEAN_animation_event);
43613
43648
 
43614
43649
  //@ts-ignore
43615
- var version = "1.1.0-beta.25";
43650
+ var version = "1.1.0-beta.28";
43616
43651
  console.log("Galacean engine version: " + version);
43617
43652
  for(var key in CoreObjects){
43618
43653
  Loader.registerClass(key, CoreObjects[key]);