public void TakePenalty(int val) //-зп { salary -= val; if (Penalty != null) { Penalty.Invoke($"Новая зарплата {salary}"); } }
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()); }