diff --git a/src/views/Block.ts b/src/views/Block.ts index b2b1352..0738a7d 100644 --- a/src/views/Block.ts +++ b/src/views/Block.ts @@ -21,6 +21,7 @@ export class Block extends Laya.Script { private sprite_show: Laya.Sprite private blockSize: number + private obj_notes: Laya.Box private label_show: Laya.Label private tips_bgs: Array = [] private tips_labels: Array = [] @@ -40,7 +41,8 @@ export class Block extends Laya.Script { this.blockSize = this.sprite_show.width this.label_show = this.owner.getChildByName("label_show") as Laya.Label - const notes = this.owner.getChildByName("notes") + const notes = this.owner.getChildByName("notes") as Laya.Box + this.obj_notes = notes for (let i = 0; i < notes.numChildren; i++) { const hbox = notes.getChildAt(i) for (let j = 0; j < hbox.numChildren; j++) { @@ -61,6 +63,12 @@ export class Block extends Laya.Script { this.updateBlock() } + public setPaused(paused: boolean): void { + this.sprite_show.visible = !paused + this.obj_notes.visible = !paused + this.label_show.visible = !paused + } + public setBlockColor(color: string, alpha: number = 1, animated: boolean = false, completedColor: string = "", completedAlpha: number = 1): void { this.sprite_show.graphics.clear() this.sprite_show.graphics.drawRect(0, 0, this.blockSize, this.blockSize, color) diff --git a/src/views/Stage.ts b/src/views/Stage.ts index ea98933..19388b6 100644 --- a/src/views/Stage.ts +++ b/src/views/Stage.ts @@ -164,6 +164,9 @@ export class Stage extends Laya.Script { if (Stage._instance) { Stage._instance.paused = arg Stage._instance.obj_mask.visible = arg + for (let i = 0; i < Stage._instance.blocks.length; i++) { + Stage._instance.blocks[i].setPaused(arg) + } } }