cc.tween能不能暂停和继续

我发现在cc.director.pause在web环境可以暂停和继续cc.tween的动作,但是在原生平台不可以。有没有合适的方案可以暂停和继续cocos动作呀

1赞

cc.Tween.stopAll()用过吗
stopbytag()

cc.tween里没有暂停,怎么写

试试找个

        this.node.pauseAllActions();
        this.node.resumeAllActions();

好的,谢谢

cc.director.getActionManager().pauseAllRunningActions()

cc.Tween.stopAll()大写的

1赞

1.节点的tween暂停恢复:
this.node.pauseAllActions();
this.node.resumeAllActions();
2.全部tween暂停恢复:
cc.director.getActionManager().pauseAllRunningActions();
cc.director.getActionManager().resumeAllRunningActions();

/**
* !#en Pauses all running actions, returning a list of targets whose actions were paused.
* !#zh 暂停所有正在运行的动作,返回一个包含了那些动作被暂停了的目标对象的列表。
* @method pauseAllRunningActions
* @return {Array} a list of targets whose actions were paused.
*/
pauseAllRunningActions:function(){
var idsWithActions = [];
var locTargets = this._arrayTargets;
for(var i = 0; i< locTargets.length; i++){
var element = locTargets[i];
if(element && !element.paused){
element.paused = true;
idsWithActions.push(element.target);
}
}
return idsWithActions;
},

resumeAllRunningActions:function(){
    var idsWithActions = [];
    var locTargets = this._arrayTargets;
    for(var i = 0; i< locTargets.length; i++){
        var element = locTargets[i];
        if(element && element.paused){
            element.paused = false;
            idsWithActions.push(element.target);
        }
    }
    return idsWithActions;
},

resumeAllRunningActions 原本没有 需要修改creator相应地方源码

1赞

用老的action函数执行停止