12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- import { director } from "cc";
- import { SoundManager } from "../../../../engines/sounds/SoundManager";
- import { GameController } from "../GameController";
- import { WeaponBase } from "../weapons/WeaponBase";
- import { SkillBase } from "./SkillBase";
- export default class DefaultSkill extends SkillBase
- {
- private startTime:number;
- /**
- * 使用技能
- * @param weapon
- * @param data
- */
- UseSkill(weapon:WeaponBase,data?:any):void{
- super.UseSkill(weapon,data);
- this.weapon.fireKey=2;
- this.weapon.MoveFirePosition();
- this.startTime=director.getCurrentTime();
- }
-
- /**
- * 更新
- * @param dt
- */
- Update(dt:number):void{
- super.Update(dt);
- let current:number=director.getCurrentTime();
- if(current-this.startTime>this.time){
- this.DispatchEvent(SkillBase.SKILL_COMPLETE);
- return;
- }
- let posType:number=GameController.single.FindAttackMonsterPosType;
- if(posType<0){
- SoundManager.single.StopSound("Weapon");
- SoundManager.single.StopSound("WeaponLeft");
- SoundManager.single.StopSound("WeaponRight");
- return;
- }
- }
-
- /**
- * 销毁
- */
- Dispose():void{
- super.Dispose();
- SoundManager.single.StopSound("Weapon");
- SoundManager.single.StopSound("WeaponLeft");
- SoundManager.single.StopSound("WeaponRight");
- }
- // /**
- // * 是否阻断玩家操作
- // */
- // get unController():boolean{
- // return false;
- // }
- // /**
- // * 射击间隔
- // */
- // get fireInterval():number{
- // return 50;
- // }
- }
|