super-hero/assets/cc-game/scripts/game_ui/GameLoseLayout.ts

23 lines
581 B
TypeScript
Raw Normal View History

2024-05-08 04:03:33 -07:00
import { _decorator, Component, Node } from 'cc';
import { UmPopupBase } from '../../../cc-common/cc-ui/UmPopupBase';
import { Button } from 'cc';
import { GameGlobalData } from '../global/GameGlobalData';
const { ccclass, property } = _decorator;
@ccclass('GameLoseLayout')
export class GameLoseLayout extends Component {
@property(Button) btnPlay: Button = null!;
protected onLoad(): void {
this.btnPlay?.node.on(Button.EventType.CLICK, this.onBtnReplayClicked, this);
}
onBtnReplayClicked()
{
GameGlobalData.Instance.newGame();
}
}