Skip to content

Commit 8539e75

Browse files
authored
[AnimComponent] Transition exit time fix (playcanvas#3153)
* use the user defined loop parameter when checking whether to use a transitions exit time * lint warning fix
1 parent 1d2dce0 commit 8539e75

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/anim/binder/default-anim-binder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ class DefaultAnimBinder {
5656
'localPosition': function (node) {
5757
var object = node.localPosition;
5858
var func = function (value) {
59-
object.set.apply(object, value);
59+
object.set(...value);
6060
};
6161
return DefaultAnimBinder.createAnimTarget(func, 'vector', 3, node, 'localPosition');
6262
},
6363

6464
'localRotation': function (node) {
6565
var object = node.localRotation;
6666
var func = function (value) {
67-
object.set.apply(object, value);
67+
object.set(...value);
6868
};
6969
return DefaultAnimBinder.createAnimTarget(func, 'quaternion', 4, node, 'localRotation');
7070
},
7171

7272
'localScale': function (node) {
7373
var object = node.localScale;
7474
var func = function (value) {
75-
object.set.apply(object, value);
75+
object.set(...value);
7676
};
7777
return DefaultAnimBinder.createAnimTarget(func, 'vector', 3, node, 'localScale');
7878
},

src/anim/controller/anim-controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class AnimController {
266266
var progressBefore = this._getActiveStateProgressForTime(this._timeInStateBefore);
267267
var progress = this._getActiveStateProgressForTime(this._timeInState);
268268
// when the exit time is smaller than 1 and the state is looping, we should check for an exit each loop
269-
if (transition.exitTime < 1.0 && this.activeState.looping) {
269+
if (transition.exitTime < 1.0 && this.activeState.loop) {
270270
progressBefore -= Math.floor(progressBefore);
271271
progress -= Math.floor(progress);
272272
}

0 commit comments

Comments
 (0)