/// <summary> /// Ends the item use. /// </summary> private void EndUse() { if (!InUse()) { return; } if (m_UseEvent != null) { Scheduler.Cancel(ref m_UseEvent); } if (m_CastParticles) { m_CastParticles.Stop(); } if (m_CastSound != null && m_CastSound.Length > 0 && m_CastMode == CastMode.Continuous) { m_AudioSource.Stop(); } if (m_RegenerateDelay != 0) { m_RegenerateEvent = Scheduler.Schedule(m_RegenerateDelay, RegenerateAmmo); } m_InUse = false; m_Used = false; m_StopContinuousUse = false; m_AimStates.NextState(); m_UseStates.NextState(); EventHandler.ExecuteEvent(m_Character, "OnItemStopUse"); }
/// <summary> /// Ends the weapon use. /// </summary> private void EndUse() { if (!m_InUse) { return; } m_InUse = false; m_AllowInterruption = false; m_UseStates.NextState(); m_RecoilStates.NextState(); EventHandler.ExecuteEvent(m_Character, "OnItemStopUse"); }