@galacean/engine 0.9.18 → 0.9.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
@@ -26002,6 +26002,7 @@
26002
26002
  curKeyframeIndex: 0,
26003
26003
  value: null
26004
26004
  };
26005
+ this.updateMark = 0;
26005
26006
  this.target = target;
26006
26007
  this.type = type;
26007
26008
  this.property = property;
@@ -27442,9 +27443,9 @@
27442
27443
  _this = Component.call(this, entity) || this;
27443
27444
  /** Culling mode of this Animator. */ _this.cullingMode = exports.AnimatorCullingMode.None;
27444
27445
  /** The playback speed of the Animator, 1.0 is normal playback speed. */ _this.speed = 1.0;
27446
+ _this._updateMark = 0;
27445
27447
  _this._animatorLayersData = [];
27446
27448
  _this._curveOwnerPool = Object.create(null);
27447
- _this._needRevertCurveOwners = [];
27448
27449
  _this._animationEventHandlerPool = new ClassPool(AnimationEventHandler);
27449
27450
  _this._tempAnimatorStateInfo = {
27450
27451
  layerIndex: -1,
@@ -27529,7 +27530,7 @@
27529
27530
  return;
27530
27531
  }
27531
27532
  deltaTime *= this.speed;
27532
- this._revertCurveOwners();
27533
+ this._updateMark++;
27533
27534
  for(var i1 = 0, n1 = animatorController.layers.length; i1 < n1; i1++){
27534
27535
  var animatorLayerData = this._getAnimatorLayerData(i1);
27535
27536
  if (animatorLayerData.layerState === LayerState.Standby) {
@@ -27579,7 +27580,6 @@
27579
27580
  }
27580
27581
  }
27581
27582
  this._animatorLayersData.length = 0;
27582
- this._needRevertCurveOwners.length = 0;
27583
27583
  this._curveOwnerPool = {};
27584
27584
  this._animationEventHandlerPool.resetPool();
27585
27585
  if (this._controllerUpdateFlag) {
@@ -27630,17 +27630,9 @@
27630
27630
  var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
27631
27631
  var property = curve.property;
27632
27632
  var instanceId = targetEntity.instanceId;
27633
- var needRevert = false;
27634
- if (this.animatorController.layers[layerIndex].blendingMode === exports.AnimatorLayerBlendingMode.Additive && layerIndex > 0) {
27635
- needRevert = true;
27636
- }
27637
27633
  // Get owner
27638
27634
  var propertyOwners = (_curveOwnerPool = curveOwnerPool)[_instanceId = instanceId] || (_curveOwnerPool[_instanceId] = Object.create(null));
27639
27635
  var owner = (_propertyOwners = propertyOwners)[_property = property] || (_propertyOwners[_property] = curve._createCurveOwner(targetEntity));
27640
- //@todo: There is performance waste here, which will be handled together with organizing AnimatorStateData later. The logic is changing from runtime to initialization.
27641
- if (needRevert) {
27642
- this._needRevertCurveOwners.push(owner);
27643
- }
27644
27636
  // Get layer owner
27645
27637
  var layerPropertyOwners = (_layerCurveOwnerPool = layerCurveOwnerPool)[_instanceId1 = instanceId] || (_layerCurveOwnerPool[_instanceId1] = Object.create(null));
27646
27638
  var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_property1 = property] || (_layerPropertyOwners[_property1] = curve._createCurveLayerOwner(owner));
@@ -27773,6 +27765,7 @@
27773
27765
  if (!owner) continue;
27774
27766
  var curve = curveBindings[i].curve;
27775
27767
  if (curve.keys.length) {
27768
+ this._checkRevertOwner(owner, additive);
27776
27769
  var value = owner.evaluateValue(curve, clipTime, additive);
27777
27770
  aniUpdate && owner.applyValue(value, weight, additive);
27778
27771
  finished && layerOwner.saveFinalValue();
@@ -27818,6 +27811,7 @@
27818
27811
  if (!owner) continue;
27819
27812
  var srcCurveIndex = layerOwner.crossSrcCurveIndex;
27820
27813
  var destCurveIndex = layerOwner.crossDestCurveIndex;
27814
+ this._checkRevertOwner(owner, additive);
27821
27815
  var value = owner.evaluateCrossFadeValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, additive);
27822
27816
  aniUpdate && owner.applyValue(value, weight, additive);
27823
27817
  finished && layerOwner.saveFinalValue();
@@ -27864,6 +27858,7 @@
27864
27858
  var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
27865
27859
  if (!owner) continue;
27866
27860
  var curveIndex = layerOwner.crossDestCurveIndex;
27861
+ this._checkRevertOwner(owner, additive);
27867
27862
  var value = layerOwner.curveOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, additive);
27868
27863
  aniUpdate && owner.applyValue(value, weight, additive);
27869
27864
  finished && layerOwner.saveFinalValue();
@@ -27890,6 +27885,7 @@
27890
27885
  var layerOwner = curveLayerOwner[i];
27891
27886
  var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
27892
27887
  if (!owner) continue;
27888
+ this._checkRevertOwner(owner, additive);
27893
27889
  owner.applyValue(layerOwner.finalValue, weight, additive);
27894
27890
  }
27895
27891
  };
@@ -28059,11 +28055,11 @@
28059
28055
  }
28060
28056
  }
28061
28057
  };
28062
- _proto._revertCurveOwners = function _revertCurveOwners() {
28063
- var curveOwners = this._needRevertCurveOwners;
28064
- for(var i = 0, n = curveOwners.length; i < n; ++i){
28065
- curveOwners[i].revertDefaultValue();
28058
+ _proto._checkRevertOwner = function _checkRevertOwner(owner, additive) {
28059
+ if (additive && owner.updateMark !== this._updateMark) {
28060
+ owner.revertDefaultValue();
28066
28061
  }
28062
+ owner.updateMark = this._updateMark;
28067
28063
  };
28068
28064
  _create_class$3(Animator, [
28069
28065
  {
@@ -28093,13 +28089,13 @@
28093
28089
  ], Animator.prototype, "_controllerUpdateFlag", void 0);
28094
28090
  __decorate$1([
28095
28091
  ignoreClone
28096
- ], Animator.prototype, "_animatorLayersData", void 0);
28092
+ ], Animator.prototype, "_updateMark", void 0);
28097
28093
  __decorate$1([
28098
28094
  ignoreClone
28099
- ], Animator.prototype, "_curveOwnerPool", void 0);
28095
+ ], Animator.prototype, "_animatorLayersData", void 0);
28100
28096
  __decorate$1([
28101
28097
  ignoreClone
28102
- ], Animator.prototype, "_needRevertCurveOwners", void 0);
28098
+ ], Animator.prototype, "_curveOwnerPool", void 0);
28103
28099
  __decorate$1([
28104
28100
  ignoreClone
28105
28101
  ], Animator.prototype, "_animationEventHandlerPool", void 0);
@@ -36386,7 +36382,7 @@
36386
36382
  }));
36387
36383
 
36388
36384
  //@ts-ignore
36389
- var version = "0.9.18";
36385
+ var version = "0.9.19";
36390
36386
  console.log("Galacean engine version: " + version);
36391
36387
  for(var key in CoreObjects){
36392
36388
  Loader.registerClass(key, CoreObjects[key]);