Menu button

This commit is contained in:
Martin
2022-12-14 08:46:34 +01:00
parent b3e9664351
commit 537c5c2855
5 changed files with 260 additions and 22 deletions

View File

@@ -1,11 +1,14 @@
import { _decorator, Component, Node } from "cc";
import { _decorator, Component, Node, Button } from "cc";
import { UIButton } from "../Services/UI/Button/UIButton";
import { GameRunner } from "./GameRunner";
const { ccclass, property } = _decorator;
@ccclass("Menu")
export class Menu extends Component {
@property(UIButton) private playBtn: UIButton;
public async start(): Promise<void> {
GameRunner.Instance.playGame();
this.playBtn.InteractedEvent.on(() => GameRunner.Instance.playGame(), this);
}
}