Exemplo n.º 1
0
    private float CalculateRandomValue()
    {
        float delayDiff    = maximumDelay - minimumDelay;
        float randomVal    = Random.value;
        float interpolated = Interpolation.Calculate(randomVal, distributionMappingCurve);
        float delay        = minimumDelay + (interpolated * delayDiff);

        return(delay);
    }
Exemplo n.º 2
0
    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;
        }
    }