1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // Learn TypeScript:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
- // Learn Attribute:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
- import EventName, { PopName } from "../EventName/EventName";
- import MyComponent from "../Template/MyComponent";
- import GamePause from "./GamePause";
- import PopManger from "./PopManger";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class GameUI extends MyComponent {
- onLoad(): void {
- super.onLoad();
- GamePause.GamePause = false
- this.regEvent(EventName.PauseCountDown, () => {
- this.node.getChildByName("bing").active = true
- }, this)
- this.regEvent(EventName.RestoreCountDown, () => {
- this.node.getChildByName("bing").active = false
- }, this)
- }
- Clickset() {
- //set
- PopManger.getInstance().Pop(PopName.Seting)
- }
- Clickpause() {
- //pause
- PopManger.getInstance().Pop(PopName.GamePause)
- }
- }
|