Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal void UpdateScore(int points) {
- Debug.Log($"UIManager Script: {points}");
- _scoreText.text = $"Score: {points}";
- }
- internal void UpdateLives(int currenLives) {
- _livesImage.sprite = _livesSprites[currenLives];
- if (currenLives.Equals(0)) {
- GameOverLogic();
- }
- }
- private void GameOverLogic() {
- _gameOverText.gameObject.SetActive(true);
- StartCoroutine(GameOverFlickerEffect());
- _gameManage.GameOver();
- }
- IEnumerator GameOverFlickerEffect() {
- while (true) {
- _gameOverText.text = "GAME OVER" + "\n\n" + "PRESS R TO RESTART";
- yield return new WaitForSeconds(0.5f);
- _gameOverText.text = string.Empty;
- yield return new WaitForSeconds(0.5f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement