/// <summary> /// 打断 /// </summary> /// <param name="interruptType"></param> public void Interrupt(SkillInteraputType interruptType) { if (CanInterrupt(interruptType)) { Phase = SkillPhase.None; } else { } }
public void Interrupt(SkillInteraputType interruptType) { foreach (var item in _baseSkills) { if (item.IsRunning) { item.Interrupt(interruptType); } } }
/// <summary> /// 是否可以被打断 /// </summary> /// <param name="interruptType"></param> /// <returns></returns> public bool CanInterrupt(SkillInteraputType interruptType) { if (Phase == SkillPhase.None || Phase == SkillPhase.Hold) { return(false); } if (Phase == SkillPhase.Start) { return((OnStart_InteraputType & interruptType) > 0); } else if (Phase == SkillPhase.Cast) { return((OnCast_InteraputType & interruptType) > 0); } else if (Phase == SkillPhase.CastEnd) { return((OnCastEnd_InteraputType & interruptType) > 0); } return(true); }