private float CalculateRandomValue() { float delayDiff = maximumDelay - minimumDelay; float randomVal = Random.value; float interpolated = Interpolation.Calculate(randomVal, distributionMappingCurve); float delay = minimumDelay + (interpolated * delayDiff); return(delay); }
private void UpdateStatus() { if (duration == 0) { currentStatus = currentStatusDelta = statusDeltaSum = 1f; } else { float newStatus = 1 - ((endTime - Time.time) / (duration)); newStatus = Mathf.Abs(newStatus); float newStatusInterpolated = Interpolation.Calculate(newStatus, interpolation); currentStatusDelta = newStatusInterpolated - currentStatus; currentStatus = newStatusInterpolated; statusDeltaSum += currentStatusDelta; } }