mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
Merge pull request #152 from 2youyouo2/master
animator should update playing anims state
This commit is contained in:
@@ -60,13 +60,40 @@ p.resumeState = function (state) {
|
||||
if (state) {
|
||||
state.resume();
|
||||
}
|
||||
|
||||
if (this.isPaused) {
|
||||
this.resume();
|
||||
}
|
||||
};
|
||||
|
||||
p.setStateTime = function (state, time) {
|
||||
if (state) {
|
||||
state.setTime(time);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
p.onStop = function () {
|
||||
var anims = this.playingAnims;
|
||||
for (var i = 0, l = anims.length; i < l; i++) {
|
||||
anims[i].stop();
|
||||
}
|
||||
|
||||
Animator.prototype.onStop.call(this);
|
||||
};
|
||||
|
||||
p.onPause = function () {
|
||||
var anims = this.playingAnims;
|
||||
for (var i = 0, l = anims.length; i < l; i++) {
|
||||
anims[i].pause();
|
||||
}
|
||||
};
|
||||
|
||||
p.onResume = function () {
|
||||
var anims = this.playingAnims;
|
||||
for (var i = 0, l = anims.length; i < l; i++) {
|
||||
anims[i].resume();
|
||||
}
|
||||
};
|
||||
|
||||
if (CC_DEV) {
|
||||
p.reloadClip = function (state) {
|
||||
|
||||
Reference in New Issue
Block a user