/// <summary> /// Stops the cast. /// </summary> public override void Stop() { if (m_StopEffect && m_Effect != null) { m_CharacterLocomotion.TryStopEffect(m_Effect); } base.Stop(); }
/// <summary> /// Stop the effect from running. /// </summary> /// <param name="fromController">Is the effect being stopped from the UltimateCharacterController?</param> public void StopEffect(bool fromController) { // If the effect wasn't stopped from the character controller then call the controller's stop effect method. The controller must be aware of the stopping. if (!fromController) { m_CharacterLocomotion.TryStopEffect(this); return; } m_ActiveIndex = -1; EffectStopped(); }
/// <summary> /// Tries to start or stop the specified effect. /// </summary> /// <returns>Success if the effect was started or stopped.</returns> public override TaskStatus OnUpdate() { if (m_Effect == null) { return(TaskStatus.Failure); } // The effect is not null - try to start or stop the effect. if (m_Start.Value) { var effectStarted = m_CharacterLocomotion.TryStartEffect(m_Effect); return((effectStarted || m_AlwaysReturnSuccess.Value) ? TaskStatus.Success : TaskStatus.Failure); } else { var effectStopped = m_CharacterLocomotion.TryStopEffect(m_Effect); return((effectStopped || m_AlwaysReturnSuccess.Value) ? TaskStatus.Success : TaskStatus.Failure); } }