var 方法1= function() {
var moveto = new cc.MoveTo(1,cc.p(0,0));
var moveEnd = function(sender) {
。。。
}.bind(this);
this.runAction(cc.sequence(moveto, new cc.CallFunc(moveEnd, this)));
}
var 方法2= function() {
var moveto = new cc.MoveTo(1,cc.p(10,10));
var moveEnd = function(sender) {
。。。
}.bind(this);
this.runAction(cc.sequence(moveto, new cc.CallFunc(moveEnd, this)));
}
var 方法3= function() {
var moveto = new cc.MoveTo(1,cc.p(100,100));
var moveEnd = function(sender) {
。。。
}.bind(this);
this.runAction(cc.sequence(moveto, new cc.CallFunc(moveEnd, this)));
}
var seq = new cc.Sequence(new cc.CallFunc(方法1, this),
new cc.CallFunc(方法2,this),
new cc.CallFunc(方法3, this)
);
this.runAction(seq);
我想让方法1,2,3按序列执行,可是是同时执行的,如果动作写在方法里面且1,2,3里面的动作对象都不是同一个对象,怎么才能进行序列操作呢
var seq = new cc.Sequence(new cc.CallFunc(方法1, this),
new cc.DelayTime(1),
new cc.CallFunc(方法2,this),
new cc.DelayTime(1),
new cc.CallFunc(方法3, this)
);
this.runAction(seq);
目前是用这种方法,但是在帧数变化的时候可能会存在bug隐患