public static FloatUpdate ( float currentValue, float targetValue, float speed ) : float | ||
currentValue | float |
/// A |
targetValue | float |
/// A |
speed | float |
/// A |
return | float |
public static float FloatUpdate(float currentValue, float targetValue, float speed)
{
float diff = targetValue - currentValue;
currentValue += (diff * speed) * Time.deltaTime;
return (currentValue);
}