private void CheckResults() { if (_playerMove == _aiMove) { OnRoundEnded?.Invoke(null); return; } var result = (int)_playerMove - (int)_aiMove; var roundResult = !(result == -1 || result == 2); if (roundResult) { _playerWins++; } else { _aiWins++; } Debug.Log($"Round result: {roundResult}"); OnScoreUpdated?.Invoke($"{_playerWins} : {_aiWins}"); OnRoundEnded?.Invoke(roundResult); }
private void OnEnemyDefeated(GameObject enemy) { enemiesDefeated++; if (enemiesDefeated < EnemyCount) { return; } Debug.Log("All enemies have been defeated. Round has ended."); if (RoundIndex + 1 == RoundCount) { CompleteLevel(); } else { OnRoundEnded?.Invoke(RoundIndex); } }
public static void RoundEnded() { OnRoundEnded?.Invoke(); }