creater2.0.9 stopAllActions对callFunc没有影响,

  • Creator 版本:2.0.9

  • 目标平台: ios,web ,android

  • 详细报错信息,包含调用堆栈:

  • 重现方式:

  • 之前哪个版本是正常的 :

  • 手机型号 :

  • 手机浏览器 :

  • 编辑器操作系统 :

  • 编辑器之前是否有其它报错 :

  • 出现概率:

  • 额外线索:

代码示例,coin.runAction(new cc.Sequence(
new cc.DelayTime(1 + t * resultCount),
new cc.CallFunc(function () {
if (coin && self.game) {
coin.parent = self.game.getChildByName(“all_pot”).getChildByName(“pot_1”);
fb.playEffect(“game_flycoin”);
}
coin.stopAllActions()
for (var i = 1; i <= 3; i++) {
// if(self.game){
self.game.getChildByName(“all_pot”).getChildByName(“pot_1”).getChildByName(“coin” + i).active = false;
// }
}
}),
new cc.MoveTo(t, endpos),
new cc.CallFunc(function () {
showResultCount += 1;
fb.UI_destroyNode(coin);
if (showResultCount == data.result.length && self.game) {
self.game.getChildByName(“all_pot”).active = false;
self.game.getChildByName(“all_pot”).getChildByName(“pot_1”).active = false;
self.game.getChildByName(“all_pot”).getChildByName(“pot_2”).active = false;
self.game.getChildByName(“all_pot”).getChildByName(“pot_3”).active = false;
self.game.getChildByName(“all_pot”).getChildByName(“pot_1”).getChildByName(“stake”).getComponent(cc.Label).string = 0;
self.game.getChildByName(“all_pot”).getChildByName(“pot_2”).getChildByName(“stake”).getComponent(cc.Label).string = 0;
self.game.getChildByName(“all_pot”).getChildByName(“pot_3”).getChildByName(“stake”).getComponent(cc.Label).string = 0;
self.game.getChildByName(“all_pot”).getChildByName(“pot_1”).getChildByName(“stake”).removeAllChildren();
self.game.getChildByName(“all_pot”).getChildByName(“pot_2”).getChildByName(“stake”).removeAllChildren();
self.game.getChildByName(“all_pot”).getChildByName(“pot_3”).getChildByName(“stake”).removeAllChildren();
}
}))
);

如代码所示,一个节点runAction,做了延迟,当场景切换,callFunc里面依然执行了逻辑代码,导致节点找不到了,死循环,卡死,在原生和web都能复现,有没有办法外部统一把callFunc停止了,使用了stopAllAction没有用,外部内部都试过了,依然进入了逻辑代码

楼主解决了吗?

只能在callfunc检查用上的node存不存在了

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。