mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
fix actionManager can't remove all actions (#3159)
This commit is contained in:
@@ -145,11 +145,16 @@ cc.ActionManager.prototype = {
|
||||
*/
|
||||
removeAllActions:function () {
|
||||
var locTargets = this._arrayTargets;
|
||||
for (var i = 0; i < locTargets.length; i++) {
|
||||
var element = locTargets[i];
|
||||
|
||||
// RemoveAllActionsFromTarget changes the length of array _arrayTargets.
|
||||
// So we iterate on the locTargets_clone instead of locTargets.
|
||||
var locTargets_clone = cc.js.array.copy(locTargets);
|
||||
for (var i = 0; i < locTargets_clone.length; i++) {
|
||||
var element = locTargets_clone[i];
|
||||
if (element)
|
||||
this.removeAllActionsFromTarget(element.target, true);
|
||||
}
|
||||
locTargets_clone.length = 0;
|
||||
},
|
||||
/**
|
||||
* !#en
|
||||
|
||||
Reference in New Issue
Block a user