diff --git a/src/Main.ts b/src/Main.ts index a0d1960..1812402 100644 --- a/src/Main.ts +++ b/src/Main.ts @@ -24,15 +24,11 @@ export class Main extends Laya.Script { { url: respath.trophy_bg_light_gold, type: Laya.Loader.IMAGE }, { url: respath.trophy_bg_light_grey, type: Laya.Loader.IMAGE } ] - Laya.loader.load(resources, - Laya.Handler.create(this, (success: Object) => { // 第二个参数:成功回调 - console.log("预加载资源结束>>>>", success) - }), - Laya.Handler.create(this, (resProg: number) => { // 第三个参数:进度回调 - console.log("预加载资源进度>>>>", resProg) - }) - ) - + Laya.loader.load(resources, Laya.Handler.create(this, (success: object) => { // 第二个参数:成功回调 + console.log("预加载资源结束>>>>", success) + }), Laya.Handler.create(this, (resProg: number) => { // 第三个参数:进度回调 + console.log("预加载资源进度>>>>", resProg) + })) } onLateUpdate(): void { diff --git a/src/models/UIManager.ts b/src/models/UIManager.ts index 2234089..e81ec9c 100644 --- a/src/models/UIManager.ts +++ b/src/models/UIManager.ts @@ -29,7 +29,7 @@ export class UIManager extends Laya.Script { onAwake(): void { UIManager._instance = this - this.mask.on(Laya.Event.CLICK, this, ()=>{ + this.mask.on(Laya.Event.CLICK, this, () => { console.log("on click mask >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>") }) this.mask.visible = false diff --git a/src/views/Block.ts b/src/views/Block.ts index 585eef1..6fb8193 100644 --- a/src/views/Block.ts +++ b/src/views/Block.ts @@ -38,7 +38,7 @@ export class Block extends Laya.Script { this.sprite_show = this.owner.getChildByName("Sprite") as Laya.Sprite this.label_show = this.owner.getChildByName("label_show") as Laya.Label - let notes = this.owner.getChildByName("notes") + const notes = this.owner.getChildByName("notes") for (let i = 0; i < notes.numChildren; i++) { const hbox = notes.getChildAt(i) for (let j = 0; j < hbox.numChildren; j++) { @@ -49,7 +49,7 @@ export class Block extends Laya.Script { this.tips_labels.push(Label) } } - + this.owner.on(Laya.Event.CLICK, handler, func) } diff --git a/src/views/GameDone.ts b/src/views/GameDone.ts index 79e7a59..558f6c2 100644 --- a/src/views/GameDone.ts +++ b/src/views/GameDone.ts @@ -45,33 +45,33 @@ export class GameDone extends Laya.Script { onStart(): void { this.owner.x = 0 this.owner.y = -this.owner.height - Laya.Tween.to(this.owner, {y: 0}, 300, Laya.Ease.elasticOut) + Laya.Tween.to(this.owner, { y: 0 }, 300, Laya.Ease.elasticOut) this.obj_summary.alpha = 0 - Laya.Tween.to(this.obj_summary, {alpha: 1}, 400, Laya.Ease.elasticOut, null, 100) + Laya.Tween.to(this.obj_summary, { alpha: 1 }, 400, Laya.Ease.elasticOut, null, 100) this.obj_summary.scaleX = 0.8 this.obj_summary.scaleY = 0.8 - Laya.Tween.to(this.obj_summary, {scaleX: 1, scaleY: 1}, 400, Laya.Ease.elasticOut, null, 100) + Laya.Tween.to(this.obj_summary, { scaleX: 1, scaleY: 1 }, 400, Laya.Ease.elasticOut, null, 100) this.star1.scaleX = 1.2 this.star1.scaleY = 1.2 - Laya.Tween.to(this.star1, {scaleX: 1, scaleY: 1}, 300, Laya.Ease.elasticOut, null, 400) + Laya.Tween.to(this.star1, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.elasticOut, null, 400) const y1 = this.star1.y this.star1.y = y1 - 10 - Laya.Tween.to(this.star1, {y: y1}, 300, Laya.Ease.elasticOut, null, 400) + Laya.Tween.to(this.star1, { y: y1 }, 300, Laya.Ease.elasticOut, null, 400) this.star2.scaleX = 1.2 this.star2.scaleY = 1.2 - Laya.Tween.to(this.star2, {scaleX: 1, scaleY: 1}, 300, Laya.Ease.elasticOut, null, 600) + Laya.Tween.to(this.star2, { scaleX: 1, scaleY: 1 }, 300, Laya.Ease.elasticOut, null, 600) const y2 = this.star2.y this.star2.y = y2 - 10 - Laya.Tween.to(this.star2, {y: y2}, 300, Laya.Ease.elasticOut, null, 600) + Laya.Tween.to(this.star2, { y: y2 }, 300, Laya.Ease.elasticOut, null, 600) this.obj_light.alpha = 0 - Laya.Tween.to(this.obj_light, {alpha: 0.2}, 500, Laya.Ease.elasticOut, null, 800) + Laya.Tween.to(this.obj_light, { alpha: 0.2 }, 500, Laya.Ease.elasticOut, null, 800) this.btn_new.alpha = 0 - Laya.Tween.to(this.btn_new, {alpha: 1}, 300, Laya.Ease.elasticOut, null, 1000) + Laya.Tween.to(this.btn_new, { alpha: 1 }, 300, Laya.Ease.elasticOut, null, 1000) } public onSetStageInfo(doStage: DOStage): void { diff --git a/src/views/common/AutoRotate.ts b/src/views/common/AutoRotate.ts index 458cbfa..d02dee5 100644 --- a/src/views/common/AutoRotate.ts +++ b/src/views/common/AutoRotate.ts @@ -1,24 +1,22 @@ -const { regClass, property } = Laya; +const { regClass, property } = Laya @regClass() export class AutoRotate extends Laya.Script { - declare owner : Laya.Image; + declare owner: Laya.Image - @property(Number) - public speed: number = 1; + @property(Number) + public speed: number = 1 - private begin = 0 + private begin = 0 - //第一次执行update之前执行,只会执行一次 - onStart(): void { - - Laya.timer.loop(100, this, ()=>{ - this.begin += this.speed - if (this.begin >= 360) { - this.begin = 0 - } - this.owner.rotation = this.begin - }) - } - -} \ No newline at end of file + // 第一次执行update之前执行,只会执行一次 + onStart(): void { + Laya.timer.loop(100, this, () => { + this.begin += this.speed + if (this.begin >= 360) { + this.begin = 0 + } + this.owner.rotation = this.begin + }) + } +}