public void Pause(InputAction.CallbackContext context) { if (context.started) { OnLevelPause?.Invoke(true); } }
public void RemoveLife() { lives -= 1; OnLifeLost?.Invoke(lives); if (lives == 0) { OnLevelPause?.Invoke(false); OnLevelLose?.Invoke(); } }
private void AddScore(int score) { this.score += score; OnScoreChange?.Invoke(this.score); if (FindObjectsOfType <Brick>().Length == 1) { OnLevelPause?.Invoke(false); OnLevelWin?.Invoke(level); } }
/// <summary> /// Pauses the current level. /// </summary> public static void PauseCurrentLevel() { OnLevelPause?.Invoke(currentLevelIndex); }