SkillManager.ts 789 B

123456789101112131415161718192021222324252627282930313233
  1. import { _decorator, Component, Node } from 'cc';
  2. import { KillAllMonsterSkill } from './KillAllMonsterSkill';
  3. import { SkillBase } from './SkillBase';
  4. const { ccclass, property } = _decorator;
  5. export default class SkillManager{
  6. constructor(){
  7. }
  8. /**
  9. * 创建技能
  10. * @param type
  11. */
  12. public Create(type:number):SkillBase{
  13. // switch (type) {
  14. // case 1:
  15. // return new KillAllMonsterSkill();
  16. // default:
  17. // break;
  18. // }
  19. return new KillAllMonsterSkill();
  20. }
  21. private static instance:SkillManager;
  22. public static get single():SkillManager{
  23. if(this.instance==null){
  24. this.instance=new SkillManager();
  25. }
  26. return this.instance;
  27. }
  28. }