@galacean/engine-core 1.0.0-beta.13 → 1.0.0-beta.15
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/main.js +27 -37
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +27 -37
- package/dist/module.js +27 -37
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/animation/Animator.d.ts +2 -2
package/dist/miniprogram.js
CHANGED
|
@@ -9482,6 +9482,7 @@ __decorate([
|
|
|
9482
9482
|
/**
|
|
9483
9483
|
* @override
|
|
9484
9484
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
9485
|
+
ReferResource.prototype._onDestroy.call(this);
|
|
9485
9486
|
this._shader = null;
|
|
9486
9487
|
this._shaderData = null;
|
|
9487
9488
|
this._renderStates.length = 0;
|
|
@@ -15447,10 +15448,10 @@ var Basic2DBatcher = /*#__PURE__*/ function() {
|
|
|
15447
15448
|
var vertexElements = [];
|
|
15448
15449
|
var vertexStride = this.createVertexElements(vertexElements);
|
|
15449
15450
|
// vertices
|
|
15450
|
-
var vertexBuffer = this._vertexBuffers[index] = new Buffer(engine, exports.BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT *
|
|
15451
|
+
var vertexBuffer = this._vertexBuffers[index] = new Buffer(engine, exports.BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT * vertexStride, exports.BufferUsage.Dynamic);
|
|
15451
15452
|
vertexBuffer.isGCIgnored = true;
|
|
15452
15453
|
// indices
|
|
15453
|
-
var indiceBuffer = this._indiceBuffers[index] = new Buffer(engine, exports.BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT *
|
|
15454
|
+
var indiceBuffer = this._indiceBuffers[index] = new Buffer(engine, exports.BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT * 6, exports.BufferUsage.Dynamic);
|
|
15454
15455
|
indiceBuffer.isGCIgnored = true;
|
|
15455
15456
|
mesh.setVertexBufferBinding(vertexBuffer, vertexStride);
|
|
15456
15457
|
mesh.setIndexBufferBinding(indiceBuffer, exports.IndexFormat.UInt16);
|
|
@@ -22683,6 +22684,7 @@ var DirtyFlag;
|
|
|
22683
22684
|
curKeyframeIndex: 0,
|
|
22684
22685
|
value: null
|
|
22685
22686
|
};
|
|
22687
|
+
this.updateMark = 0;
|
|
22686
22688
|
this.target = target;
|
|
22687
22689
|
this.type = type;
|
|
22688
22690
|
this.property = property;
|
|
@@ -24156,9 +24158,9 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24156
24158
|
_this = Component.call(this, entity) || this;
|
|
24157
24159
|
/** Culling mode of this Animator. */ _this.cullingMode = exports.AnimatorCullingMode.None;
|
|
24158
24160
|
/** The playback speed of the Animator, 1.0 is normal playback speed. */ _this.speed = 1.0;
|
|
24161
|
+
_this._updateMark = 0;
|
|
24159
24162
|
_this._animatorLayersData = [];
|
|
24160
24163
|
_this._curveOwnerPool = Object.create(null);
|
|
24161
|
-
_this._needRevertCurveOwners = [];
|
|
24162
24164
|
_this._animationEventHandlerPool = new ClassPool(AnimationEventHandler);
|
|
24163
24165
|
_this._tempAnimatorStateInfo = {
|
|
24164
24166
|
layerIndex: -1,
|
|
@@ -24186,10 +24188,10 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24186
24188
|
return;
|
|
24187
24189
|
}
|
|
24188
24190
|
if (!state.clip) {
|
|
24189
|
-
|
|
24191
|
+
Logger.warn("The state named " + stateName + " has no AnimationClip data.");
|
|
24190
24192
|
return;
|
|
24191
24193
|
}
|
|
24192
|
-
var animatorLayerData = this._getAnimatorLayerData(
|
|
24194
|
+
var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
|
|
24193
24195
|
var animatorStateData = this._getAnimatorStateData(stateName, state, animatorLayerData, playLayerIndex);
|
|
24194
24196
|
this._preparePlay(animatorLayerData, state);
|
|
24195
24197
|
animatorLayerData.layerState = LayerState.Playing;
|
|
@@ -24208,8 +24210,8 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24208
24210
|
if ((_this__controllerUpdateFlag = this._controllerUpdateFlag) == null ? void 0 : _this__controllerUpdateFlag.flag) {
|
|
24209
24211
|
this._reset();
|
|
24210
24212
|
}
|
|
24211
|
-
var
|
|
24212
|
-
var manuallyTransition = this._getAnimatorLayerData(
|
|
24213
|
+
var _this__getAnimatorStateInfo = this._getAnimatorStateInfo(stateName, layerIndex), state = _this__getAnimatorStateInfo.state, playLayerIndex = _this__getAnimatorStateInfo.layerIndex;
|
|
24214
|
+
var manuallyTransition = this._getAnimatorLayerData(playLayerIndex).manuallyTransition;
|
|
24213
24215
|
manuallyTransition.duration = normalizedTransitionDuration;
|
|
24214
24216
|
manuallyTransition.offset = normalizedTimeOffset;
|
|
24215
24217
|
manuallyTransition.destinationState = state;
|
|
@@ -24242,7 +24244,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24242
24244
|
return;
|
|
24243
24245
|
}
|
|
24244
24246
|
deltaTime *= this.speed;
|
|
24245
|
-
this.
|
|
24247
|
+
this._updateMark++;
|
|
24246
24248
|
for(var i1 = 0, n1 = animatorController.layers.length; i1 < n1; i1++){
|
|
24247
24249
|
var animatorLayerData = this._getAnimatorLayerData(i1);
|
|
24248
24250
|
if (animatorLayerData.layerState === LayerState.Standby) {
|
|
@@ -24290,7 +24292,6 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24290
24292
|
}
|
|
24291
24293
|
}
|
|
24292
24294
|
this._animatorLayersData.length = 0;
|
|
24293
|
-
this._needRevertCurveOwners.length = 0;
|
|
24294
24295
|
this._curveOwnerPool = {};
|
|
24295
24296
|
this._animationEventHandlerPool.resetPool();
|
|
24296
24297
|
if (this._controllerUpdateFlag) {
|
|
@@ -24332,8 +24333,8 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24332
24333
|
_proto._saveAnimatorStateData = function _saveAnimatorStateData(animatorState, animatorStateData, animatorLayerData, layerIndex) {
|
|
24333
24334
|
var _this = this, entity = _this.entity, curveOwnerPool = _this._curveOwnerPool;
|
|
24334
24335
|
var curveLayerOwner = animatorStateData.curveLayerOwner;
|
|
24335
|
-
var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
|
|
24336
24336
|
var _animatorState_clip = animatorState.clip, curves = _animatorState_clip._curveBindings;
|
|
24337
|
+
var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
|
|
24337
24338
|
for(var i = curves.length - 1; i >= 0; i--){
|
|
24338
24339
|
var curve = curves[i];
|
|
24339
24340
|
var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
|
|
@@ -24341,29 +24342,16 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24341
24342
|
var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
|
|
24342
24343
|
var property = curve.property;
|
|
24343
24344
|
var instanceId = targetEntity.instanceId;
|
|
24344
|
-
var needRevert = false;
|
|
24345
|
-
var baseAnimatorLayerData = this._animatorLayersData[0];
|
|
24346
|
-
var baseLayerCurveOwnerPool = baseAnimatorLayerData.curveOwnerPool;
|
|
24347
|
-
if (this.animatorController.layers[layerIndex].blendingMode === exports.AnimatorLayerBlendingMode.Additive && layerIndex > 0 && !(baseLayerCurveOwnerPool[instanceId] && baseLayerCurveOwnerPool[instanceId][property])) {
|
|
24348
|
-
needRevert = true;
|
|
24349
|
-
}
|
|
24350
24345
|
// Get owner
|
|
24351
24346
|
var propertyOwners = (_curveOwnerPool = curveOwnerPool)[_instanceId = instanceId] || (_curveOwnerPool[_instanceId] = Object.create(null));
|
|
24352
24347
|
var owner = (_propertyOwners = propertyOwners)[_property = property] || (_propertyOwners[_property] = curve._createCurveOwner(targetEntity));
|
|
24353
|
-
//@todo: There is performance waste here, which will be handled together with organizing AnimatorStateData later. The logic is changing from runtime to initialization.
|
|
24354
|
-
if (needRevert) {
|
|
24355
|
-
this._needRevertCurveOwners.push(owner);
|
|
24356
|
-
} else {
|
|
24357
|
-
var index = this._needRevertCurveOwners.indexOf(owner);
|
|
24358
|
-
index > -1 && this._needRevertCurveOwners.splice(index, 1);
|
|
24359
|
-
}
|
|
24360
24348
|
// Get layer owner
|
|
24361
24349
|
var layerPropertyOwners = (_layerCurveOwnerPool = layerCurveOwnerPool)[_instanceId1 = instanceId] || (_layerCurveOwnerPool[_instanceId1] = Object.create(null));
|
|
24362
24350
|
var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_property1 = property] || (_layerPropertyOwners[_property1] = curve._createCurveLayerOwner(owner));
|
|
24363
24351
|
curveLayerOwner[i] = layerOwner;
|
|
24364
24352
|
} else {
|
|
24365
24353
|
curveLayerOwner[i] = null;
|
|
24366
|
-
|
|
24354
|
+
Logger.warn("The entity don't have the child entity which path is " + curve.relativePath + ".");
|
|
24367
24355
|
}
|
|
24368
24356
|
}
|
|
24369
24357
|
};
|
|
@@ -24489,6 +24477,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24489
24477
|
if (!owner) continue;
|
|
24490
24478
|
var curve = curveBindings[i].curve;
|
|
24491
24479
|
if (curve.keys.length) {
|
|
24480
|
+
this._checkRevertOwner(owner, additive);
|
|
24492
24481
|
var value = owner.evaluateValue(curve, clipTime, additive);
|
|
24493
24482
|
aniUpdate && owner.applyValue(value, weight, additive);
|
|
24494
24483
|
finished && layerOwner.saveFinalValue();
|
|
@@ -24534,6 +24523,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24534
24523
|
if (!owner) continue;
|
|
24535
24524
|
var srcCurveIndex = layerOwner.crossSrcCurveIndex;
|
|
24536
24525
|
var destCurveIndex = layerOwner.crossDestCurveIndex;
|
|
24526
|
+
this._checkRevertOwner(owner, additive);
|
|
24537
24527
|
var value = owner.evaluateCrossFadeValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, additive);
|
|
24538
24528
|
aniUpdate && owner.applyValue(value, weight, additive);
|
|
24539
24529
|
finished && layerOwner.saveFinalValue();
|
|
@@ -24580,6 +24570,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24580
24570
|
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
24581
24571
|
if (!owner) continue;
|
|
24582
24572
|
var curveIndex = layerOwner.crossDestCurveIndex;
|
|
24573
|
+
this._checkRevertOwner(owner, additive);
|
|
24583
24574
|
var value = layerOwner.curveOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, additive);
|
|
24584
24575
|
aniUpdate && owner.applyValue(value, weight, additive);
|
|
24585
24576
|
finished && layerOwner.saveFinalValue();
|
|
@@ -24606,6 +24597,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24606
24597
|
var layerOwner = curveLayerOwner[i];
|
|
24607
24598
|
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
24608
24599
|
if (!owner) continue;
|
|
24600
|
+
this._checkRevertOwner(owner, additive);
|
|
24609
24601
|
owner.applyValue(layerOwner.finalValue, weight, additive);
|
|
24610
24602
|
}
|
|
24611
24603
|
};
|
|
@@ -24631,16 +24623,14 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24631
24623
|
var curveLayerOwner = srcPlayData.stateData.curveLayerOwner;
|
|
24632
24624
|
for(var i = curveLayerOwner.length - 1; i >= 0; i--){
|
|
24633
24625
|
var _curveLayerOwner_i;
|
|
24634
|
-
|
|
24635
|
-
owner.revertDefaultValue();
|
|
24626
|
+
(_curveLayerOwner_i = curveLayerOwner[i]) == null ? void 0 : _curveLayerOwner_i.curveOwner.revertDefaultValue();
|
|
24636
24627
|
}
|
|
24637
24628
|
}
|
|
24638
24629
|
} else {
|
|
24639
24630
|
// layerState is CrossFading, FixedCrossFading, Standby, Finished
|
|
24640
24631
|
var crossLayerOwnerCollection = layerData.crossLayerOwnerCollection;
|
|
24641
24632
|
for(var i1 = crossLayerOwnerCollection.length - 1; i1 >= 0; i1--){
|
|
24642
|
-
|
|
24643
|
-
owner1.revertDefaultValue();
|
|
24633
|
+
crossLayerOwnerCollection[i1].curveOwner.revertDefaultValue();
|
|
24644
24634
|
}
|
|
24645
24635
|
}
|
|
24646
24636
|
};
|
|
@@ -24663,7 +24653,7 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24663
24653
|
return;
|
|
24664
24654
|
}
|
|
24665
24655
|
if (!crossState.clip) {
|
|
24666
|
-
|
|
24656
|
+
Logger.warn("The state named " + name + " has no AnimationClip data.");
|
|
24667
24657
|
return;
|
|
24668
24658
|
}
|
|
24669
24659
|
var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
|
|
@@ -24675,12 +24665,12 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24675
24665
|
destPlayData.reset(crossState, animatorStateData, offset);
|
|
24676
24666
|
switch(layerState){
|
|
24677
24667
|
case LayerState.Standby:
|
|
24668
|
+
case LayerState.Finished:
|
|
24678
24669
|
animatorLayerData.layerState = LayerState.FixedCrossFading;
|
|
24679
24670
|
this._clearCrossData(animatorLayerData);
|
|
24680
24671
|
this._prepareStandbyCrossFading(animatorLayerData);
|
|
24681
24672
|
break;
|
|
24682
24673
|
case LayerState.Playing:
|
|
24683
|
-
case LayerState.Finished:
|
|
24684
24674
|
animatorLayerData.layerState = LayerState.CrossFading;
|
|
24685
24675
|
this._clearCrossData(animatorLayerData);
|
|
24686
24676
|
this._prepareCrossFading(animatorLayerData);
|
|
@@ -24777,11 +24767,11 @@ exports.AnimatorLayerBlendingMode = void 0;
|
|
|
24777
24767
|
}
|
|
24778
24768
|
}
|
|
24779
24769
|
};
|
|
24780
|
-
_proto.
|
|
24781
|
-
|
|
24782
|
-
|
|
24783
|
-
curveOwners[i].revertDefaultValue();
|
|
24770
|
+
_proto._checkRevertOwner = function _checkRevertOwner(owner, additive) {
|
|
24771
|
+
if (additive && owner.updateMark !== this._updateMark) {
|
|
24772
|
+
owner.revertDefaultValue();
|
|
24784
24773
|
}
|
|
24774
|
+
owner.updateMark = this._updateMark;
|
|
24785
24775
|
};
|
|
24786
24776
|
_create_class(Animator, [
|
|
24787
24777
|
{
|
|
@@ -24811,13 +24801,13 @@ __decorate([
|
|
|
24811
24801
|
], Animator.prototype, "_controllerUpdateFlag", void 0);
|
|
24812
24802
|
__decorate([
|
|
24813
24803
|
ignoreClone
|
|
24814
|
-
], Animator.prototype, "
|
|
24804
|
+
], Animator.prototype, "_updateMark", void 0);
|
|
24815
24805
|
__decorate([
|
|
24816
24806
|
ignoreClone
|
|
24817
|
-
], Animator.prototype, "
|
|
24807
|
+
], Animator.prototype, "_animatorLayersData", void 0);
|
|
24818
24808
|
__decorate([
|
|
24819
24809
|
ignoreClone
|
|
24820
|
-
], Animator.prototype, "
|
|
24810
|
+
], Animator.prototype, "_curveOwnerPool", void 0);
|
|
24821
24811
|
__decorate([
|
|
24822
24812
|
ignoreClone
|
|
24823
24813
|
], Animator.prototype, "_animationEventHandlerPool", void 0);
|
package/dist/module.js
CHANGED
|
@@ -9477,6 +9477,7 @@ __decorate([
|
|
|
9477
9477
|
/**
|
|
9478
9478
|
* @override
|
|
9479
9479
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
9480
|
+
ReferResource.prototype._onDestroy.call(this);
|
|
9480
9481
|
this._shader = null;
|
|
9481
9482
|
this._shaderData = null;
|
|
9482
9483
|
this._renderStates.length = 0;
|
|
@@ -15442,10 +15443,10 @@ var Basic2DBatcher = /*#__PURE__*/ function() {
|
|
|
15442
15443
|
var vertexElements = [];
|
|
15443
15444
|
var vertexStride = this.createVertexElements(vertexElements);
|
|
15444
15445
|
// vertices
|
|
15445
|
-
var vertexBuffer = this._vertexBuffers[index] = new Buffer(engine, BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT *
|
|
15446
|
+
var vertexBuffer = this._vertexBuffers[index] = new Buffer(engine, BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT * vertexStride, BufferUsage.Dynamic);
|
|
15446
15447
|
vertexBuffer.isGCIgnored = true;
|
|
15447
15448
|
// indices
|
|
15448
|
-
var indiceBuffer = this._indiceBuffers[index] = new Buffer(engine, BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT *
|
|
15449
|
+
var indiceBuffer = this._indiceBuffers[index] = new Buffer(engine, BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT * 6, BufferUsage.Dynamic);
|
|
15449
15450
|
indiceBuffer.isGCIgnored = true;
|
|
15450
15451
|
mesh.setVertexBufferBinding(vertexBuffer, vertexStride);
|
|
15451
15452
|
mesh.setIndexBufferBinding(indiceBuffer, IndexFormat.UInt16);
|
|
@@ -22678,6 +22679,7 @@ var DirtyFlag;
|
|
|
22678
22679
|
curKeyframeIndex: 0,
|
|
22679
22680
|
value: null
|
|
22680
22681
|
};
|
|
22682
|
+
this.updateMark = 0;
|
|
22681
22683
|
this.target = target;
|
|
22682
22684
|
this.type = type;
|
|
22683
22685
|
this.property = property;
|
|
@@ -24151,9 +24153,9 @@ var AnimatorLayerBlendingMode;
|
|
|
24151
24153
|
_this = Component.call(this, entity) || this;
|
|
24152
24154
|
/** Culling mode of this Animator. */ _this.cullingMode = AnimatorCullingMode.None;
|
|
24153
24155
|
/** The playback speed of the Animator, 1.0 is normal playback speed. */ _this.speed = 1.0;
|
|
24156
|
+
_this._updateMark = 0;
|
|
24154
24157
|
_this._animatorLayersData = [];
|
|
24155
24158
|
_this._curveOwnerPool = Object.create(null);
|
|
24156
|
-
_this._needRevertCurveOwners = [];
|
|
24157
24159
|
_this._animationEventHandlerPool = new ClassPool(AnimationEventHandler);
|
|
24158
24160
|
_this._tempAnimatorStateInfo = {
|
|
24159
24161
|
layerIndex: -1,
|
|
@@ -24181,10 +24183,10 @@ var AnimatorLayerBlendingMode;
|
|
|
24181
24183
|
return;
|
|
24182
24184
|
}
|
|
24183
24185
|
if (!state.clip) {
|
|
24184
|
-
|
|
24186
|
+
Logger.warn("The state named " + stateName + " has no AnimationClip data.");
|
|
24185
24187
|
return;
|
|
24186
24188
|
}
|
|
24187
|
-
var animatorLayerData = this._getAnimatorLayerData(
|
|
24189
|
+
var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
|
|
24188
24190
|
var animatorStateData = this._getAnimatorStateData(stateName, state, animatorLayerData, playLayerIndex);
|
|
24189
24191
|
this._preparePlay(animatorLayerData, state);
|
|
24190
24192
|
animatorLayerData.layerState = LayerState.Playing;
|
|
@@ -24203,8 +24205,8 @@ var AnimatorLayerBlendingMode;
|
|
|
24203
24205
|
if ((_this__controllerUpdateFlag = this._controllerUpdateFlag) == null ? void 0 : _this__controllerUpdateFlag.flag) {
|
|
24204
24206
|
this._reset();
|
|
24205
24207
|
}
|
|
24206
|
-
var
|
|
24207
|
-
var manuallyTransition = this._getAnimatorLayerData(
|
|
24208
|
+
var _this__getAnimatorStateInfo = this._getAnimatorStateInfo(stateName, layerIndex), state = _this__getAnimatorStateInfo.state, playLayerIndex = _this__getAnimatorStateInfo.layerIndex;
|
|
24209
|
+
var manuallyTransition = this._getAnimatorLayerData(playLayerIndex).manuallyTransition;
|
|
24208
24210
|
manuallyTransition.duration = normalizedTransitionDuration;
|
|
24209
24211
|
manuallyTransition.offset = normalizedTimeOffset;
|
|
24210
24212
|
manuallyTransition.destinationState = state;
|
|
@@ -24237,7 +24239,7 @@ var AnimatorLayerBlendingMode;
|
|
|
24237
24239
|
return;
|
|
24238
24240
|
}
|
|
24239
24241
|
deltaTime *= this.speed;
|
|
24240
|
-
this.
|
|
24242
|
+
this._updateMark++;
|
|
24241
24243
|
for(var i1 = 0, n1 = animatorController.layers.length; i1 < n1; i1++){
|
|
24242
24244
|
var animatorLayerData = this._getAnimatorLayerData(i1);
|
|
24243
24245
|
if (animatorLayerData.layerState === LayerState.Standby) {
|
|
@@ -24285,7 +24287,6 @@ var AnimatorLayerBlendingMode;
|
|
|
24285
24287
|
}
|
|
24286
24288
|
}
|
|
24287
24289
|
this._animatorLayersData.length = 0;
|
|
24288
|
-
this._needRevertCurveOwners.length = 0;
|
|
24289
24290
|
this._curveOwnerPool = {};
|
|
24290
24291
|
this._animationEventHandlerPool.resetPool();
|
|
24291
24292
|
if (this._controllerUpdateFlag) {
|
|
@@ -24327,8 +24328,8 @@ var AnimatorLayerBlendingMode;
|
|
|
24327
24328
|
_proto._saveAnimatorStateData = function _saveAnimatorStateData(animatorState, animatorStateData, animatorLayerData, layerIndex) {
|
|
24328
24329
|
var _this = this, entity = _this.entity, curveOwnerPool = _this._curveOwnerPool;
|
|
24329
24330
|
var curveLayerOwner = animatorStateData.curveLayerOwner;
|
|
24330
|
-
var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
|
|
24331
24331
|
var _animatorState_clip = animatorState.clip, curves = _animatorState_clip._curveBindings;
|
|
24332
|
+
var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
|
|
24332
24333
|
for(var i = curves.length - 1; i >= 0; i--){
|
|
24333
24334
|
var curve = curves[i];
|
|
24334
24335
|
var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
|
|
@@ -24336,29 +24337,16 @@ var AnimatorLayerBlendingMode;
|
|
|
24336
24337
|
var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
|
|
24337
24338
|
var property = curve.property;
|
|
24338
24339
|
var instanceId = targetEntity.instanceId;
|
|
24339
|
-
var needRevert = false;
|
|
24340
|
-
var baseAnimatorLayerData = this._animatorLayersData[0];
|
|
24341
|
-
var baseLayerCurveOwnerPool = baseAnimatorLayerData.curveOwnerPool;
|
|
24342
|
-
if (this.animatorController.layers[layerIndex].blendingMode === AnimatorLayerBlendingMode.Additive && layerIndex > 0 && !(baseLayerCurveOwnerPool[instanceId] && baseLayerCurveOwnerPool[instanceId][property])) {
|
|
24343
|
-
needRevert = true;
|
|
24344
|
-
}
|
|
24345
24340
|
// Get owner
|
|
24346
24341
|
var propertyOwners = (_curveOwnerPool = curveOwnerPool)[_instanceId = instanceId] || (_curveOwnerPool[_instanceId] = Object.create(null));
|
|
24347
24342
|
var owner = (_propertyOwners = propertyOwners)[_property = property] || (_propertyOwners[_property] = curve._createCurveOwner(targetEntity));
|
|
24348
|
-
//@todo: There is performance waste here, which will be handled together with organizing AnimatorStateData later. The logic is changing from runtime to initialization.
|
|
24349
|
-
if (needRevert) {
|
|
24350
|
-
this._needRevertCurveOwners.push(owner);
|
|
24351
|
-
} else {
|
|
24352
|
-
var index = this._needRevertCurveOwners.indexOf(owner);
|
|
24353
|
-
index > -1 && this._needRevertCurveOwners.splice(index, 1);
|
|
24354
|
-
}
|
|
24355
24343
|
// Get layer owner
|
|
24356
24344
|
var layerPropertyOwners = (_layerCurveOwnerPool = layerCurveOwnerPool)[_instanceId1 = instanceId] || (_layerCurveOwnerPool[_instanceId1] = Object.create(null));
|
|
24357
24345
|
var layerOwner = (_layerPropertyOwners = layerPropertyOwners)[_property1 = property] || (_layerPropertyOwners[_property1] = curve._createCurveLayerOwner(owner));
|
|
24358
24346
|
curveLayerOwner[i] = layerOwner;
|
|
24359
24347
|
} else {
|
|
24360
24348
|
curveLayerOwner[i] = null;
|
|
24361
|
-
|
|
24349
|
+
Logger.warn("The entity don't have the child entity which path is " + curve.relativePath + ".");
|
|
24362
24350
|
}
|
|
24363
24351
|
}
|
|
24364
24352
|
};
|
|
@@ -24484,6 +24472,7 @@ var AnimatorLayerBlendingMode;
|
|
|
24484
24472
|
if (!owner) continue;
|
|
24485
24473
|
var curve = curveBindings[i].curve;
|
|
24486
24474
|
if (curve.keys.length) {
|
|
24475
|
+
this._checkRevertOwner(owner, additive);
|
|
24487
24476
|
var value = owner.evaluateValue(curve, clipTime, additive);
|
|
24488
24477
|
aniUpdate && owner.applyValue(value, weight, additive);
|
|
24489
24478
|
finished && layerOwner.saveFinalValue();
|
|
@@ -24529,6 +24518,7 @@ var AnimatorLayerBlendingMode;
|
|
|
24529
24518
|
if (!owner) continue;
|
|
24530
24519
|
var srcCurveIndex = layerOwner.crossSrcCurveIndex;
|
|
24531
24520
|
var destCurveIndex = layerOwner.crossDestCurveIndex;
|
|
24521
|
+
this._checkRevertOwner(owner, additive);
|
|
24532
24522
|
var value = owner.evaluateCrossFadeValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, additive);
|
|
24533
24523
|
aniUpdate && owner.applyValue(value, weight, additive);
|
|
24534
24524
|
finished && layerOwner.saveFinalValue();
|
|
@@ -24575,6 +24565,7 @@ var AnimatorLayerBlendingMode;
|
|
|
24575
24565
|
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
24576
24566
|
if (!owner) continue;
|
|
24577
24567
|
var curveIndex = layerOwner.crossDestCurveIndex;
|
|
24568
|
+
this._checkRevertOwner(owner, additive);
|
|
24578
24569
|
var value = layerOwner.curveOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, additive);
|
|
24579
24570
|
aniUpdate && owner.applyValue(value, weight, additive);
|
|
24580
24571
|
finished && layerOwner.saveFinalValue();
|
|
@@ -24601,6 +24592,7 @@ var AnimatorLayerBlendingMode;
|
|
|
24601
24592
|
var layerOwner = curveLayerOwner[i];
|
|
24602
24593
|
var owner = layerOwner == null ? void 0 : layerOwner.curveOwner;
|
|
24603
24594
|
if (!owner) continue;
|
|
24595
|
+
this._checkRevertOwner(owner, additive);
|
|
24604
24596
|
owner.applyValue(layerOwner.finalValue, weight, additive);
|
|
24605
24597
|
}
|
|
24606
24598
|
};
|
|
@@ -24626,16 +24618,14 @@ var AnimatorLayerBlendingMode;
|
|
|
24626
24618
|
var curveLayerOwner = srcPlayData.stateData.curveLayerOwner;
|
|
24627
24619
|
for(var i = curveLayerOwner.length - 1; i >= 0; i--){
|
|
24628
24620
|
var _curveLayerOwner_i;
|
|
24629
|
-
|
|
24630
|
-
owner.revertDefaultValue();
|
|
24621
|
+
(_curveLayerOwner_i = curveLayerOwner[i]) == null ? void 0 : _curveLayerOwner_i.curveOwner.revertDefaultValue();
|
|
24631
24622
|
}
|
|
24632
24623
|
}
|
|
24633
24624
|
} else {
|
|
24634
24625
|
// layerState is CrossFading, FixedCrossFading, Standby, Finished
|
|
24635
24626
|
var crossLayerOwnerCollection = layerData.crossLayerOwnerCollection;
|
|
24636
24627
|
for(var i1 = crossLayerOwnerCollection.length - 1; i1 >= 0; i1--){
|
|
24637
|
-
|
|
24638
|
-
owner1.revertDefaultValue();
|
|
24628
|
+
crossLayerOwnerCollection[i1].curveOwner.revertDefaultValue();
|
|
24639
24629
|
}
|
|
24640
24630
|
}
|
|
24641
24631
|
};
|
|
@@ -24658,7 +24648,7 @@ var AnimatorLayerBlendingMode;
|
|
|
24658
24648
|
return;
|
|
24659
24649
|
}
|
|
24660
24650
|
if (!crossState.clip) {
|
|
24661
|
-
|
|
24651
|
+
Logger.warn("The state named " + name + " has no AnimationClip data.");
|
|
24662
24652
|
return;
|
|
24663
24653
|
}
|
|
24664
24654
|
var animatorLayerData = this._getAnimatorLayerData(playLayerIndex);
|
|
@@ -24670,12 +24660,12 @@ var AnimatorLayerBlendingMode;
|
|
|
24670
24660
|
destPlayData.reset(crossState, animatorStateData, offset);
|
|
24671
24661
|
switch(layerState){
|
|
24672
24662
|
case LayerState.Standby:
|
|
24663
|
+
case LayerState.Finished:
|
|
24673
24664
|
animatorLayerData.layerState = LayerState.FixedCrossFading;
|
|
24674
24665
|
this._clearCrossData(animatorLayerData);
|
|
24675
24666
|
this._prepareStandbyCrossFading(animatorLayerData);
|
|
24676
24667
|
break;
|
|
24677
24668
|
case LayerState.Playing:
|
|
24678
|
-
case LayerState.Finished:
|
|
24679
24669
|
animatorLayerData.layerState = LayerState.CrossFading;
|
|
24680
24670
|
this._clearCrossData(animatorLayerData);
|
|
24681
24671
|
this._prepareCrossFading(animatorLayerData);
|
|
@@ -24772,11 +24762,11 @@ var AnimatorLayerBlendingMode;
|
|
|
24772
24762
|
}
|
|
24773
24763
|
}
|
|
24774
24764
|
};
|
|
24775
|
-
_proto.
|
|
24776
|
-
|
|
24777
|
-
|
|
24778
|
-
curveOwners[i].revertDefaultValue();
|
|
24765
|
+
_proto._checkRevertOwner = function _checkRevertOwner(owner, additive) {
|
|
24766
|
+
if (additive && owner.updateMark !== this._updateMark) {
|
|
24767
|
+
owner.revertDefaultValue();
|
|
24779
24768
|
}
|
|
24769
|
+
owner.updateMark = this._updateMark;
|
|
24780
24770
|
};
|
|
24781
24771
|
_create_class(Animator, [
|
|
24782
24772
|
{
|
|
@@ -24806,13 +24796,13 @@ __decorate([
|
|
|
24806
24796
|
], Animator.prototype, "_controllerUpdateFlag", void 0);
|
|
24807
24797
|
__decorate([
|
|
24808
24798
|
ignoreClone
|
|
24809
|
-
], Animator.prototype, "
|
|
24799
|
+
], Animator.prototype, "_updateMark", void 0);
|
|
24810
24800
|
__decorate([
|
|
24811
24801
|
ignoreClone
|
|
24812
|
-
], Animator.prototype, "
|
|
24802
|
+
], Animator.prototype, "_animatorLayersData", void 0);
|
|
24813
24803
|
__decorate([
|
|
24814
24804
|
ignoreClone
|
|
24815
|
-
], Animator.prototype, "
|
|
24805
|
+
], Animator.prototype, "_curveOwnerPool", void 0);
|
|
24816
24806
|
__decorate([
|
|
24817
24807
|
ignoreClone
|
|
24818
24808
|
], Animator.prototype, "_animationEventHandlerPool", void 0);
|