123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import { LQCollideSystem } from "./Collide/lq_collide_system/lq_collide_system";
- import { UIList } from "./Core/Ui/UIDef";
- import { UILayerNames, UILayers } from "./Core/Ui/UILayers";
- import { UIMgr } from "./Core/Ui/UIMgr";
- import bullet from "./game/bullet";
- import { ConfigMgr } from "./game/cfg/configMgr";
- import { Barrage } from "./game/nest/barrage";
- import { LevelMgr } from "./levelMgr";
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class Start extends cc.Component {
- /*===========================自动绑定组件开始===========================*/
- /*自动生成*/
- @property({type:cc.Node, displayName:""})
- private $bulletLayer_node:cc.Node = null;
- /*自动生成*/
- @property({type:cc.Node, displayName:""})
- private $level_node:cc.Node = null;
- /*自动生成*/
- @property({type:cc.Label, displayName:""})
- private $levelTitle_lb:cc.Label = null;
- /*自动生成*/
- @property({type:cc.Node, displayName:""})
- private $ui_node:cc.Node = null;
- /*===========================自动绑定组件结束===========================*/
- /*===========================自动生成按钮事件开始==========================*/
- /*===========================自动生成按钮事件结束==========================*/
-
- @property(cc.Prefab) bulletPrefab:cc.Prefab = null;
-
- static inst: Start;
- constructor(){
- super();
- }
- protected async onLoad(): Promise<void> {
- Start.inst = this;
- // let node = new cc.Node()
- UIMgr.inst.setup(this.$ui_node, UILayerNames.length, UILayerNames);
- LQCollideSystem.is_enable = true;
- cc.director.getPhysicsManager().enabled = true;
- cc.director.getPhysicsManager().gravity = cc.v2(0, 0);
- await ConfigMgr.inst.init();
- LevelMgr.inst.parent = this.$level_node;
- LevelMgr.inst.title = this.$levelTitle_lb
- LevelMgr.inst.begin();
- // this.testUI();
- Barrage.inst.parent = this.$bulletLayer_node;
- UIMgr.inst.showUI(UIList.debug);
- }
- private testUI() {
- UIMgr.inst.showUI(UIList.loading);
- UIMgr.inst.showUI(UIList.loading);
- setTimeout(() => {
- UIMgr.inst.hideUI(UIList.loading);
- }, 10000);
- }
- }
|