isDone 判断动作完成没 网页正常返回true 客户端返回的一直是false!!!被我return掉了 找了好一会的bug
自带模拟器你也可以自己试试 打印的值和网页不同
好的 你在2.0.5上测过么
//网页正常!安卓和iOS不正常,isDone返回的一直是false
// console.log("isDone:"+this.switchAction.isDone());
// if(typeof this.switchAction!="undefined" && this.switchAction.isDone()==false){
// return;
// }
if(typeof this.xValue=="undefined"){
this.xValue=-414;
}
var moveTo = cc.moveTo(0.5,this.xValue, 0);
this.switchAction=this.menuNode.runAction(cc.sequence(
moveTo,
cc.callFunc(function() {
// console.log("移动完成");
//换图
var pull=cc.find("btn_pull/btn_pull_guan",this.menuNode);
pull.active = !pull.active;
this.xValue==-414 ? this.xValue=-642 : this.xValue=-414;
}.bind(this),this))
).easing(cc.easeElasticIn(3.0));
好的 我看下
没有 1.9.3的热更和2.0.5的热更不一样 用模拟器打开会报错的 所以就算了
暂时解决方法。。0.5秒内执行改成0.1秒 让用户没机会移动过程中再继续点击。。如果继续点击到 位置会错乱 但是等它停了再继续点击一下 就又正常位置了
又或者定时让点击事件启不启动。。
####这个不是bug,这是你脚本执行逻辑上的问题 道理和你的解决方案类似 只有在这个动作真正已经完成执行了才能输出true
var test = cc.moveBy(3,cc.p(100,100));
this.node.runAction(test);
setTimeout(function () {
console.log(test.isDone()); //输出true
},4000);
var test = cc.moveBy(0,cc.p(100,100));
this.node.runAction(test);
console.log(test.isDone()); //输出false
也可能加了.easing(cc.easeElasticIn(3.0)); 导致的?
网页是没问题 安卓iOS都不行 运行结束了好一会 才继续执行该方法打印isDone 结果还是false
看来是有这个问题 加了.easing(cc.easeElasticIn(3.0)); 之后浏览器和模拟器的表现不一致了 这个我们在2.0上修复了
2.0+的给个大厅和子游戏的热更demo? 实现不了的话 只能在1.8里面玩了
我们现在没有这种demo呀 只能靠你自己啦~ 我争取写一个出来
别搞事啊。。2.0之后 热更我也重新搞了份 截图我也重新搞了份 现在子游戏啥的怕是有毒。。holo不住
我1.10.2也是同样的问题,无奈在结尾加入cc.callFunc,设置一个变量标记结束。
网页调试是好的,模拟器,安卓下isDone都是false