修正代码格式

This commit is contained in:
2025-05-30 16:52:51 +08:00
parent 84d1ac4798
commit 2b4ff0638b
7 changed files with 24 additions and 33 deletions

View File

@@ -17,7 +17,7 @@
{ {
"_$type": "cd70cd5e-b4cd-4277-ac0a-2224cfbe89ac", "_$type": "cd70cd5e-b4cd-4277-ac0a-2224cfbe89ac",
"scriptPath": "../src/models/UIManager.ts", "scriptPath": "../src/models/UIManager.ts",
"debug": true, "debug": false,
"mask": { "mask": {
"_$ref": "2668mvhf" "_$ref": "2668mvhf"
}, },
@@ -64,7 +64,8 @@
"_$comp": [ "_$comp": [
{ {
"_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17", "_$type": "a541bdfc-e8e1-4795-b68e-7138c5190f17",
"scriptPath": "../src/views/common/CommonHover.ts" "scriptPath": "../src/views/common/CommonHover.ts",
"hoverAlpha": true
} }
], ],
"_$child": [ "_$child": [

View File

@@ -1,4 +1,3 @@
import { config } from "./constants/config"
import { respath } from "./constants/respath" import { respath } from "./constants/respath"
import { DCManager } from "./models/DCManager" import { DCManager } from "./models/DCManager"
import { LevelManager } from "./models/LevelManager" import { LevelManager } from "./models/LevelManager"
@@ -8,8 +7,6 @@ const { regClass } = Laya
@regClass() @regClass()
export class Main extends Laya.Script { export class Main extends Laya.Script {
onAwake() { onAwake() {
console.log("Game onAwake") console.log("Game onAwake")
DCManager.getInstance().init() DCManager.getInstance().init()

View File

@@ -1,5 +1,4 @@
import type { DOBlock } from "../models/DOBlock" import type { DOBlock } from "../models/DOBlock"
import { config } from "../constants/config"
import { G_ShowScoreTips } from "../views/common/GUITips" import { G_ShowScoreTips } from "../views/common/GUITips"
const { regClass, property } = Laya const { regClass, property } = Laya

View File

@@ -136,7 +136,6 @@ export class Home extends Laya.Script {
this.btn_go.visible = false this.btn_go.visible = false
} }
} }
} }
public onClickNew(_evt: Laya.Event): void { public onClickNew(_evt: Laya.Event): void {

View File

@@ -1,27 +1,24 @@
const { regClass, property } = Laya; const { regClass, property } = Laya
@regClass() @regClass()
export class CommonHover extends Laya.Script { export class CommonHover extends Laya.Script {
declare owner : Laya.Box; declare owner: Laya.Box
@property(Boolean) @property(Boolean)
public hoverAlpha: boolean = true public hoverAlpha: boolean = true
onAwake(): void {
onAwake(): void { this.owner.on(Laya.Event.MOUSE_OVER, this, () => {
this.owner.on(Laya.Event.MOUSE_OVER, this, ()=>{ Laya.Render.canvas.style.cursor = "pointer"
Laya.Render.canvas.style.cursor = "pointer" if (this.hoverAlpha) {
if (this.hoverAlpha) { this.owner.alpha = 0.7
this.owner.alpha = 0.7 }
} })
}) this.owner.on(Laya.Event.MOUSE_OUT, this, () => {
this.owner.on(Laya.Event.MOUSE_OUT, this, ()=>{ Laya.Render.canvas.style.cursor = ""
Laya.Render.canvas.style.cursor = "" if (this.hoverAlpha) {
if (this.hoverAlpha) { this.owner.alpha = 1
this.owner.alpha = 1 }
} })
}) }
}
}
}

View File

@@ -1,5 +1,3 @@
import { config } from "../../constants/config"
const { regClass, property } = Laya const { regClass, property } = Laya
@regClass() @regClass()
@@ -48,7 +46,7 @@ export class CalendarUnit extends Laya.Script {
// 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
onAwake(): void { onAwake(): void {
this.pieSize = this.sprite_pie.width /2 this.pieSize = this.sprite_pie.width / 2
} }
public setCalendarUnit(year: number, month: number, day: number, open: boolean, progress: number, handler: any, func: any): void { public setCalendarUnit(year: number, month: number, day: number, open: boolean, progress: number, handler: any, func: any): void {

View File

@@ -165,7 +165,7 @@ export class DailyChallenge extends Laya.Script {
this.currentIndex = i this.currentIndex = i
break break
} }
} }
this.loadWithIndex(this.currentIndex) this.loadWithIndex(this.currentIndex)
} }