From 606c5a78fd57f08b7c3c6734126ddbcd0551a818 Mon Sep 17 00:00:00 2001 From: yangwen Date: Tue, 27 May 2025 15:30:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=86=B2=E7=AA=81=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Block.ts | 29 +++++++++++++++-------------- src/views/Stage.ts | 10 +++++----- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/views/Block.ts b/src/views/Block.ts index 90bd08e..9b8ed65 100644 --- a/src/views/Block.ts +++ b/src/views/Block.ts @@ -66,11 +66,14 @@ export class Block extends Laya.Script { this.owner.graphics.clear() this.owner.graphics.drawRect(0, 0, blockSize, blockSize, color) if (animated) { - Laya.Tween.to(this.owner, {alpha:alpha}, 500, Laya.Ease.elasticOut, Laya.Handler.create(this, () => { + this.owner.alpha = 0 + Laya.Tween.to(this.owner, {alpha:alpha}, 100, Laya.Ease.linearIn) + Laya.Tween.to(this.owner, {alpha:0}, 150, Laya.Ease.linearIn, null, 100) + Laya.Tween.to(this.owner, {alpha:alpha}, 100, Laya.Ease.linearIn, Laya.Handler.create(this, () => { this.owner.graphics.clear() this.owner.graphics.drawRect(0, 0, blockSize, blockSize, completedColor) this.owner.alpha = completedAlpha - })) + }), 250) } else { this.owner.alpha = alpha @@ -79,20 +82,18 @@ export class Block extends Laya.Script { public setFadeAnimation(): void { var color = this.label_show.color - var flag = true - Laya.timer.loop(200, this, ()=>{ - flag = !flag - if (flag) { + Laya.timer.once(200, this, ()=>{ + this.label_show.color = "#ff0000" + Laya.timer.once(100, this, ()=>{ this.label_show.color = color - } - else { - this.label_show.color = "#ff0000" - } + Laya.timer.once(200, this, ()=>{ + this.label_show.color = "#ff0000" + Laya.timer.once(100, this, ()=>{ + this.label_show.color = color + }) + }) + }) }) - Laya.Tween.to(this.label_show, {color:"#ff0000"}, 1000, Laya.Ease.strongIn, Laya.Handler.create(this, () => { - this.label_show.color = color - Laya.timer.clearAll(this) - })) } public setTipsBgColor(visible: boolean, noteNumber: number=0, color: string="", alpha: number=1): void { diff --git a/src/views/Stage.ts b/src/views/Stage.ts index 388182e..657e8ca 100644 --- a/src/views/Stage.ts +++ b/src/views/Stage.ts @@ -265,11 +265,11 @@ export class Stage extends Laya.Script { else { var sames = this.findSameNumberBlocks(block)//相同数字的格子 for (var i=0; i