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

        if (lives == 0)
        {
            OnLevelPause?.Invoke(false);
            OnLevelLose?.Invoke();
        }
    }
Beispiel #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);
        }
    }
Beispiel #4
0
 /// <summary>
 /// Pauses the current level.
 /// </summary>
 public static void PauseCurrentLevel()
 {
     OnLevelPause?.Invoke(currentLevelIndex);
 }