SkillManager.ts 729 B

1234567891011121314151617181920212223242526272829303132
  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. }
  20. private static instance:SkillManager;
  21. public static get single():SkillManager{
  22. if(this.instance==null){
  23. this.instance=new SkillManager();
  24. }
  25. return this.instance;
  26. }
  27. }