Start.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { UIList } from "./Core/Ui/UIDef";
  2. import { UILayerNames } from "./Core/Ui/UILayers";
  3. import { UIMgr } from "./Core/Ui/UIMgr";
  4. const {ccclass, property} = cc._decorator;
  5. @ccclass
  6. export default class Start extends cc.Component {
  7. /*===========================自动绑定组件开始===========================*/
  8. /*自动生成*/
  9. @property({type:cc.Node, displayName:""})
  10. private $ui_node:cc.Node = null;
  11. /*===========================自动绑定组件结束===========================*/
  12. /*===========================自动生成按钮事件开始==========================*/
  13. /*===========================自动生成按钮事件结束==========================*/
  14. constructor(){
  15. super();
  16. }
  17. protected async onLoad(): Promise<void> {
  18. UIMgr.inst.setup(this.$ui_node, UILayerNames.length, UILayerNames);
  19. }
  20. private testUI() {
  21. UIMgr.inst.showUI(UIList.loading);
  22. UIMgr.inst.showUI(UIList.loading);
  23. setTimeout(() => {
  24. UIMgr.inst.hideUI(UIList.loading);
  25. }, 10000);
  26. }
  27. }