Exemple #1
0
 public void Pause(InputAction.CallbackContext context)
 {
     if (context.started)
     {
         OnLevelPause?.Invoke(true);
     }
 }
Exemple #2
0
    public void RemoveLife()
    {
        lives -= 1;
        OnLifeLost?.Invoke(lives);

        if (lives == 0)
        {
            OnLevelPause?.Invoke(false);
            OnLevelLose?.Invoke();
        }
    }
Exemple #3
0
    private void AddScore(int score)
    {
        this.score += score;
        OnScoreChange?.Invoke(this.score);

        if (FindObjectsOfType <Brick>().Length == 1)
        {
            OnLevelPause?.Invoke(false);
            OnLevelWin?.Invoke(level);
        }
    }
Exemple #4
0
 /// <summary>
 /// Pauses the current level.
 /// </summary>
 public static void PauseCurrentLevel()
 {
     OnLevelPause?.Invoke(currentLevelIndex);
 }