Exemplo n.º 1
0
 public void TakePenalty(int val) //-зп
 {
     salary -= val;
     if (Penalty != null)
     {
         Penalty.Invoke($"Новая зарплата {salary}");
     }
 }
Exemplo n.º 2
0
    private IEnumerator CountdownWorker()
    {
        stage = RaceStage.Countdown;
        var time = 3f;

        do
        {
            time     -= Time.deltaTime;
            countdown = Mathf.FloorToInt(time) + 1;

            foreach (var item in competitors)
            {
                if (item.navigator.TotalDistanceTravelled > 1f)
                {
                    item.penalties.Add(Penalties.Jumpstart);
                    item.navigator.TotalDistanceTravelled = 0f;
                    OnPenalty.Invoke(item);
                }
            }

            yield return(null);
        } while (time > 0);
        StartCoroutine(RaceWorker());
    }