예제 #1
0
    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);
    }
예제 #2
0
    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);
        }
    }
예제 #3
0
 public static void RoundEnded()
 {
     OnRoundEnded?.Invoke();
 }