public bool Update(float deltaTime, ref AxisBase axis) { if (!string.IsNullOrEmpty(name)) { try { inputValue = CinemachineCore.GetInputAxis(name); } catch (ArgumentException) {} //catch (ArgumentException e) { Debug.LogError(e.ToString()); } } float input = inputValue * multiplier; if (deltaTime < Epsilon) { mCurrentSpeed = 0; } else { float speed = input / deltaTime; float dampTime = Mathf.Abs(speed) < Mathf.Abs(mCurrentSpeed) ? decelTime : accelTime; speed = mCurrentSpeed + Damper.Damp(speed - mCurrentSpeed, dampTime, deltaTime); mCurrentSpeed = speed; // Decelerate to the end points of the range if not wrapping float range = axis.m_MaxValue - axis.m_MinValue; if (!axis.m_Wrap && decelTime > Epsilon && range > Epsilon) { float v0 = ClampValue(ref axis, axis.m_Value); float v = ClampValue(ref axis, v0 + speed * deltaTime); float d = (speed > 0) ? axis.m_MaxValue - v : v - axis.m_MinValue; if (d < (0.1f * range) && Mathf.Abs(speed) > Epsilon) { speed = Damper.Damp(v - v0, decelTime, deltaTime) / deltaTime; } } input = speed * deltaTime; } axis.m_Value = ClampValue(ref axis, axis.m_Value + input); return(Mathf.Abs(inputValue) > Epsilon); }