public void OnUnitReachGoal() { if (EndRound() && allUnitsSpawned) { StopAllCoroutines(); OnRoundEndEvent?.Invoke(); FindObjectOfType <UiManager>().counter = 20; StartCoroutine(StartCounter()); StartCoroutine(ContinueGame()); allUnitsSpawned = false; } }
public void OnKillMethod(GameObject unit) { int amount = unit.GetComponent <Unit>().unitDescirption.goldRevarde; KillEvent?.Invoke(amount); if (EndRound() && allUnitsSpawned) { StopAllCoroutines(); OnRoundEndEvent?.Invoke(); FindObjectOfType <UiManager>().counter = 20; StartCoroutine(StartCounter()); StartCoroutine(ContinueGame()); allUnitsSpawned = false; } }