MonsterMgr.ts 674 B

123456789101112131415161718192021222324
  1. import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
  2. import { resMgr } from '../../Frames/ResourcesMgr';
  3. import { ModulerBase } from './ModulerBase';
  4. const { ccclass, property } = _decorator;
  5. @ccclass('MonsterMgr')
  6. export class MonsterMgr extends ModulerBase {
  7. @property(Prefab)
  8. monsterPre: Prefab = null;
  9. start() {
  10. //this.monsterPre = resMgr.getPrefab("Monster");
  11. this.schedule(()=>{
  12. //const monster = instantiate(this.monsterPre);
  13. const monster = instantiate(resMgr.getPrefab("Monster"));
  14. monster.parent = this.node;
  15. }, 2)
  16. }
  17. update(deltaTime: number) {
  18. }
  19. }