Files
sudoku/src/views/Home.ts
2025-05-09 19:10:40 +08:00

44 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { UIManager } from "../models/UIManager";
const { regClass, property } = Laya
@regClass()
export class Home extends Laya.Script {
declare owner : Laya.Box;
@property(Laya.Button)
public btn_start: Laya.Button;
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
onAwake(): void {
this.btn_start.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
console.log("btn_start=", evt);
this.owner.visible = false;
UIManager.getInstance().loadStage();
})
}
//组件被启用后执行,例如节点被添加到舞台后
//onEnable(): void {}
//组件被禁用时执行,例如从节点从舞台移除后
//onDisable(): void {}
//第一次执行update之前执行只会执行一次
// onStart(): void {}
//手动调用节点销毁时执行
//onDestroy(): void {}
//每帧更新时执行尽量不要在这里写大循环逻辑或者使用getComponent方法
//onUpdate(): void {}
//每帧更新时执行在update之后执行尽量不要在这里写大循环逻辑或者使用getComponent方法
//onLateUpdate(): void {}
//鼠标点击后执行。与交互相关的还有onMouseDown等十多个函数具体请参阅文档。
//onMouseClick(): void {}
}