[]tween有这个一个bug

先创建一个timeline循环按钮动画
var timeLine = new Laya.TimeLine();
timeLine.addLabel("ZoomIn",0).to(share.btShare,{scaleX:0.9, scaleY:0.9},400,Laya.Tween.cubicOut,0)
.addLabel("ZoomOut",0).to(share.btShare,{scaleX:1.0, scaleY:1.0},400,Laya.Tween.cubicOut,0);
timeLine.play(0,true);

然后循环创建依次执行ui的延迟动画
Laya.Tween.to(point,{x:point.x,y:point.y,alpha:1,update:Laya.Handler.create(point,function(){
this.visible = true;
})},800,Laya.Ease.backOut,null,i*400);

timeline在一开始还在正常执行, 当有一半左右的ui元素进入到场景时, timeline循环卡住不动了, 等所有ui动画执行完毕, timeline又开始运动
 
 
 
 
已邀请:

qian

赞同来自:

你可以上传个例子我们看下么~谢谢

zszen

赞同来自:

this.SceneMajor.removeChildren();
var share = new ShareUI();
share.scaleX = this.Scale2d.x;
share.scaleY = this.Scale2d.y;
share.x = this.Move2d.x;
share.y = this.Move2d.y;
this.SceneMajor.addChild(share);
share.btShare.on('click',this,function(){
// Laya.SoundManager.playSound(SfxPool.btPress, 1, null);
this.SceneShareDark();
});
share.btSignUp.on('click',this, SignUp_Func);
var timeLine = new Laya.TimeLine();
timeLine.addLabel("ZoomIn",0).to(share.btShare,{scaleX:0.9, scaleY:0.9},400,Laya.Tween.cubicOut,0)
.addLabel("ZoomOut",0).to(share.btShare,{scaleX:1.0, scaleY:1.0},400,Laya.Tween.cubicOut,0);
timeLine.play(0,true);
timeLine = new Laya.TimeLine();
timeLine.addLabel("ZoomIn",0).to(share.btSignUp,{scaleX:0.9, scaleY:0.9},400,Laya.Tween.cubicOut,0)
.addLabel("ZoomOut",0).to(share.btSignUp,{scaleX:1.0, scaleY:1.0},400,Laya.Tween.cubicOut,0);
timeLine.play(0,true);

Laya.Tween.to(share.title,{y:share.title.y},800,Laya.Ease.backOut,null,1000);
share.title.y-=150;
for (var i = 1; i <= 9; i++) {
var line = share['l'+i];
var point = share['p'+i];
if(i==FocusNum){
point.skin = "simbols/trave_3f.png";
}
if(i<9){
line.visible=false;
line.scaleX = 0.1;
Laya.Tween.to(line,{scaleX:1,update:Laya.Handler.create(line,function(){
this.visible = true;
})},800,Laya.Ease.cubicIn,null,(i+1)*400);
}
point.visible=false;
point.alpha = 0;
// console.log(line);
Laya.Tween.to(point,{x:point.x,y:point.y,alpha:1,update:Laya.Handler.create(point,function(){
this.visible = true;
})},800,Laya.Ease.backOut,null,i*400);
if(i%2==1 && i!=9){
point.x-=200;
}else{
point.x+=200;
}
}

要回复问题请先

商务合作
商务合作