public void TweenValue(float floatPercentage) { if (ValidTarget()) { float arg = Mathf.Lerp(m_StartValue, m_TargetValue, floatPercentage); m_Target.Invoke(arg); } }
/// <summary> /// Tweens the float based on percentage. /// </summary> /// <param name="floatPercentage">Float percentage.</param> public void TweenValue(float floatPercentage) { if (!ValidTarget()) { return; } m_Target.Invoke(Mathf.Lerp(m_StartFloat, m_TargetFloat, floatPercentage)); }
/// <summary> /// <para>Interpola el float basado en el porcentaje.</para> /// </summary> /// <param name="valor">porcentaje.</param> public void TweenValor(float valor) // Interpola el float basado en el porcentaje { // Si el objetivo no es valido, volver if (!TargetValido()) { return; } objetivo.Invoke(Mathf.Lerp(floatInicial, floatFinal, valor)); }
public void TweenValue(float floatPercentage) { if (!ValidTarget()) { return; } var newValue = Mathf.Lerp(m_StartValue, m_TargetValue, floatPercentage); m_Target.Invoke(newValue); }
public void TweenValue(float floatPercentage) { if (!ValidOnChangedTarget()) { return; } var newValue = Mathf.Lerp(m_StartValue, m_TargetValue, floatPercentage); m_OnChangedTarget.Invoke(newValue); if (Math.Abs(floatPercentage - 1f) < Mathf.Epsilon) { m_OnCompleteTarget.Invoke(); } }
public void TweenValue(float floatPercentage) { if (!ValidTarget()) { return; } //差值 var newValue = Mathf.Lerp(m_StartValue, m_TargetValue, floatPercentage); //回调 m_Target.Invoke(newValue); //结束时回调 if (floatPercentage == 1.0f && !endState) { if (m_TargetEnd != null) { m_TargetEnd.Invoke(); } endState = true; } }