TowerMgr.ts 688 B

12345678910111213141516171819202122232425262728
  1. import { _decorator, instantiate, Prefab, Vec3 } from 'cc';
  2. import { ModulerBase } from './ModulerBase';
  3. import { GameMgr } from './GameMgr';
  4. import { MapMgr } from './MapMgr';
  5. const { ccclass, property } = _decorator;
  6. @ccclass('TowerMgr')
  7. export class TowerMgr extends ModulerBase {
  8. @property(Prefab)
  9. pre: Prefab = null;
  10. start() {
  11. //GameMgr.Instance.getModuler(MapMgr).test();
  12. //this.getModuler(MapMgr).test();
  13. }
  14. creatTower(pos: Vec3){
  15. const node = instantiate(this.pre);
  16. node.setPosition(pos);
  17. node.parent = this.node;
  18. }
  19. protected clearSelf(): void {
  20. }
  21. update(deltaTime: number) {
  22. }
  23. }