Exemplo n.º 1
0
    public void DoAwardPoints()
    {
        if (!canAward)
        {
            return;
        }

        endTime = timeSystem.GetTimer();

        float timeItTook = startTime - endTime;

        int extraPoints = 0;

        if (timeItTook <= shortTime)
        {
            extraPoints = shortPoints;
            OnShort.Invoke(standardPoints + extraPoints);
        }
        else if (timeItTook <= mediumTime)
        {
            extraPoints = mediumPoints;
            OnMedium.Invoke(standardPoints + extraPoints);
        }
        else
        {
            extraPoints = longPoints;
            OnLong.Invoke(standardPoints + extraPoints);
        }

        pointSystem.AddPoints(standardPoints + extraPoints);

        // Restart time
        startTime = timeSystem.GetTimer();
    }
Exemplo n.º 2
0
 void TriggerEvents(PlaybackSpeed givenSpeed)
 {
     if (givenSpeed == PlaybackSpeed.Slow)
     {
         OnSlow?.Invoke();
     }
     else if (givenSpeed == PlaybackSpeed.Medium)
     {
         OnMedium?.Invoke();
     }
     else if (givenSpeed == PlaybackSpeed.Fast)
     {
         OnFast?.Invoke();
     }
 }