UI_GameRules.ts 881 B

1234567891011121314151617181920212223242526
  1. import { _decorator } from "cc";
  2. import { GameUILayers, gui } from "../../../core/ui/ui";
  3. import ui_base from "../../../core/ui/ui_base";
  4. import { ModuleDef } from "../../../Scripts/ModuleDef";
  5. import { ani_ui } from "../UI_Main/UI_Main";
  6. import { Layout_GameRules } from "./Layout_GameRules";
  7. const { ccclass, property } = _decorator;
  8. @ccclass('UI_GameRules')
  9. export class UI_GameRules extends ui_base {
  10. constructor() {
  11. super(ModuleDef.GAME, 'ui/UI_GameRules/GameRules', GameUILayers.HUD, Layout_GameRules);
  12. }
  13. protected async onCreated() {
  14. const layout = this.getLayout<Layout_GameRules>();
  15. ani_ui(layout.Close_Btn.node.parent);
  16. this.onButtonEvent(layout.Close_Btn, async (button: any) => {
  17. //关闭设置界面
  18. gui.close(UI_GameRules);
  19. }, this);
  20. }
  21. }