MonsterMgr.ts 600 B

1234567891011121314151617181920212223
  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 Component {
  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. monster.parent = this.node;
  14. }, 2)
  15. }
  16. update(deltaTime: number) {
  17. }
  18. }