Slash-The-Hordes/assets/Scripts/Menu/Menu.ts

26 lines
704 B
TypeScript
Raw Normal View History

2022-12-14 07:46:34 +00:00
import { _decorator, Component, Node, Button } from "cc";
2022-12-15 10:14:35 +00:00
import { type } from "os";
2022-12-14 07:46:34 +00:00
import { UIButton } from "../Services/UI/Button/UIButton";
2022-12-12 08:15:27 +00:00
2022-12-07 09:47:46 +00:00
import { GameRunner } from "./GameRunner";
const { ccclass, property } = _decorator;
@ccclass("Menu")
export class Menu extends Component {
2022-12-14 07:46:34 +00:00
@property(UIButton) private playBtn: UIButton;
2022-12-15 10:14:35 +00:00
@property(UIButton) private upgradeBtn: UIButton;
2022-12-14 07:46:34 +00:00
2022-12-12 08:15:27 +00:00
public async start(): Promise<void> {
2022-12-15 10:14:35 +00:00
this.playBtn.InteractedEvent.on(this.startGame, this);
this.upgradeBtn.InteractedEvent.on(this.openUpgradesWindow, this);
2022-12-07 09:47:46 +00:00
}
2022-12-15 10:14:35 +00:00
private startGame(): void {
GameRunner.Instance.playGame();
}
private openUpgradesWindow(): void {}
2022-12-07 09:47:46 +00:00
}
2022-12-15 10:14:35 +00:00