SkillManager.ts 855 B

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