@galacean/engine 0.9.17 → 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,
@@ -27473,7 +27474,7 @@
27473
27474
  return;
27474
27475
  }
27475
27476
  if (!state.clip) {
27476
- console.warn("The state named " + stateName + " has no AnimationClip data.");
27477
+ Logger.warn("The state named " + stateName + " has no AnimationClip data.");
27477
27478
  return;
27478
27479
  }
27479
27480
  var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
@@ -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,27 +27630,16 @@
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
- } else {
27644
- var index = this._needRevertCurveOwners.indexOf(owner);
27645
- index > -1 && this._needRevertCurveOwners.splice(index, 1);
27646
- }
27647
27636
  // Get layer owner
27648
27637
  var layerPropertyOwners = (_layerCurveOwnerPool = layerCurveOwnerPool)[_instanceId1 = instanceId] || (_layerCurveOwnerPool[_instanceId1] = Object.create(null));
27649
27638
  var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_property1 = property] || (_layerPropertyOwners[_property1] = curve._createCurveLayerOwner(owner));
27650
27639
  curveLayerOwner[i] = layerOwner;
27651
27640
  } else {
27652
27641
  curveLayerOwner[i] = null;
27653
- console.warn("The entity don't have the child entity which path is " + curve.relativePath + ".");
27642
+ Logger.warn("The entity don't have the child entity which path is " + curve.relativePath + ".");
27654
27643
  }
27655
27644
  }
27656
27645
  };
@@ -27776,6 +27765,7 @@
27776
27765
  if (!owner) continue;
27777
27766
  var curve = curveBindings[i].curve;
27778
27767
  if (curve.keys.length) {
27768
+ this._checkRevertOwner(owner, additive);
27779
27769
  var value = owner.evaluateValue(curve, clipTime, additive);
27780
27770
  aniUpdate && owner.applyValue(value, weight, additive);
27781
27771
  finished && layerOwner.saveFinalValue();
@@ -27821,6 +27811,7 @@
27821
27811
  if (!owner) continue;
27822
27812
  var srcCurveIndex = layerOwner.crossSrcCurveIndex;
27823
27813
  var destCurveIndex = layerOwner.crossDestCurveIndex;
27814
+ this._checkRevertOwner(owner, additive);
27824
27815
  var value = owner.evaluateCrossFadeValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, additive);
27825
27816
  aniUpdate && owner.applyValue(value, weight, additive);
27826
27817
  finished && layerOwner.saveFinalValue();
@@ -27867,6 +27858,7 @@
27867
27858
  var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
27868
27859
  if (!owner) continue;
27869
27860
  var curveIndex = layerOwner.crossDestCurveIndex;
27861
+ this._checkRevertOwner(owner, additive);
27870
27862
  var value = layerOwner.curveOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, additive);
27871
27863
  aniUpdate && owner.applyValue(value, weight, additive);
27872
27864
  finished && layerOwner.saveFinalValue();
@@ -27893,6 +27885,7 @@
27893
27885
  var layerOwner = curveLayerOwner[i];
27894
27886
  var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
27895
27887
  if (!owner) continue;
27888
+ this._checkRevertOwner(owner, additive);
27896
27889
  owner.applyValue(layerOwner.finalValue, weight, additive);
27897
27890
  }
27898
27891
  };
@@ -27948,7 +27941,7 @@
27948
27941
  return;
27949
27942
  }
27950
27943
  if (!crossState.clip) {
27951
- console.warn("The state named " + name + " has no AnimationClip data.");
27944
+ Logger.warn("The state named " + name + " has no AnimationClip data.");
27952
27945
  return;
27953
27946
  }
27954
27947
  var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
@@ -27960,12 +27953,12 @@
27960
27953
  destPlayData.reset(crossState, animatorStateData, offset);
27961
27954
  switch(layerState){
27962
27955
  case LayerState.Standby:
27956
+ case LayerState.Finished:
27963
27957
  animatorLayerData.layerState = LayerState.FixedCrossFading;
27964
27958
  this._clearCrossData(animatorLayerData);
27965
27959
  this._prepareStandbyCrossFading(animatorLayerData);
27966
27960
  break;
27967
27961
  case LayerState.Playing:
27968
- case LayerState.Finished:
27969
27962
  animatorLayerData.layerState = LayerState.CrossFading;
27970
27963
  this._clearCrossData(animatorLayerData);
27971
27964
  this._prepareCrossFading(animatorLayerData);
@@ -28062,11 +28055,11 @@
28062
28055
  }
28063
28056
  }
28064
28057
  };
28065
- _proto._revertCurveOwners = function _revertCurveOwners() {
28066
- var curveOwners = this._needRevertCurveOwners;
28067
- for(var i = 0, n = curveOwners.length; i < n; ++i){
28068
- curveOwners[i].revertDefaultValue();
28058
+ _proto._checkRevertOwner = function _checkRevertOwner(owner, additive) {
28059
+ if (additive && owner.updateMark !== this._updateMark) {
28060
+ owner.revertDefaultValue();
28069
28061
  }
28062
+ owner.updateMark = this._updateMark;
28070
28063
  };
28071
28064
  _create_class$3(Animator, [
28072
28065
  {
@@ -28096,13 +28089,13 @@
28096
28089
  ], Animator.prototype, "_controllerUpdateFlag", void 0);
28097
28090
  __decorate$1([
28098
28091
  ignoreClone
28099
- ], Animator.prototype, "_animatorLayersData", void 0);
28092
+ ], Animator.prototype, "_updateMark", void 0);
28100
28093
  __decorate$1([
28101
28094
  ignoreClone
28102
- ], Animator.prototype, "_curveOwnerPool", void 0);
28095
+ ], Animator.prototype, "_animatorLayersData", void 0);
28103
28096
  __decorate$1([
28104
28097
  ignoreClone
28105
- ], Animator.prototype, "_needRevertCurveOwners", void 0);
28098
+ ], Animator.prototype, "_curveOwnerPool", void 0);
28106
28099
  __decorate$1([
28107
28100
  ignoreClone
28108
28101
  ], Animator.prototype, "_animationEventHandlerPool", void 0);
@@ -36389,7 +36382,7 @@
36389
36382
  }));
36390
36383
 
36391
36384
  //@ts-ignore
36392
- var version = "0.9.17";
36385
+ var version = "0.9.19";
36393
36386
  console.log("Galacean engine version: " + version);
36394
36387
  for(var key in CoreObjects){
36395
36388
  Loader.registerClass(key, CoreObjects[key]);