GameUI.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
  7. import EventName, { PopName } from "../EventName/EventName";
  8. import MyComponent from "../Template/MyComponent";
  9. import GamePause from "./GamePause";
  10. import PopManger from "./PopManger";
  11. const { ccclass, property } = cc._decorator;
  12. @ccclass
  13. export default class GameUI extends MyComponent {
  14. onLoad(): void {
  15. super.onLoad();
  16. GamePause.GamePause = false
  17. this.regEvent(EventName.PauseCountDown, () => {
  18. this.node.getChildByName("bing").active = true
  19. }, this)
  20. this.regEvent(EventName.RestoreCountDown, () => {
  21. this.node.getChildByName("bing").active = false
  22. }, this)
  23. }
  24. Clickset() {
  25. //set
  26. PopManger.getInstance().Pop(PopName.Seting)
  27. }
  28. Clickpause() {
  29. //pause
  30. PopManger.getInstance().Pop(PopName.GamePause)
  31. }
  32. }