Advertisement
EdGr87

Untitled

Jan 5th, 2023
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1.   internal void UpdateScore(int points) {
  2.         Debug.Log($"UIManager Script: {points}");
  3.         _scoreText.text = $"Score: {points}";
  4.     }
  5.     internal void UpdateLives(int currenLives) {
  6.         _livesImage.sprite = _livesSprites[currenLives];
  7.  
  8.         if (currenLives.Equals(0)) {
  9.             GameOverLogic();
  10.         }
  11.     }
  12.  
  13.     private void GameOverLogic() {
  14.         _gameOverText.gameObject.SetActive(true);
  15.         StartCoroutine(GameOverFlickerEffect());
  16.         _gameManage.GameOver();
  17.     }
  18.  
  19.     IEnumerator GameOverFlickerEffect() {
  20.  
  21.         while (true) {
  22.             _gameOverText.text = "GAME OVER" + "\n\n" + "PRESS R TO RESTART";
  23.             yield return new WaitForSeconds(0.5f);
  24.             _gameOverText.text = string.Empty;
  25.             yield return new WaitForSeconds(0.5f);
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement