Last active
October 22, 2021 02:13
-
-
Save curious-username/a1ae2b4b59fceaf25b4e2a763cd664d5 to your computer and use it in GitHub Desktop.
Health in player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private GameObject _rightEngine, _leftEngine; | |
private int _lives = 3; | |
public void AddHealth() | |
{ | |
_powerupSound.Play(); | |
if (_lives < 3) | |
{ | |
_lives++; | |
_uiManager.UpdateLives(_lives); | |
if(_lives == 2) | |
{ | |
_leftEngine.SetActive(false); | |
} | |
else if(_lives == 3) | |
{ | |
_rightEngine.SetActive(false); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment