完善冲突动画
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user