Skip to content

Instantly share code, notes, and snippets.

@daniele-quero
Created June 24, 2021 08:42
Show Gist options
  • Save daniele-quero/9b8bf741daf80b9b1414bab826ffd718 to your computer and use it in GitHub Desktop.
Save daniele-quero/9b8bf741daf80b9b1414bab826ffd718 to your computer and use it in GitHub Desktop.
damage player method
public void Damage(int dmg)
{
_lives -= dmg;
if (_lives < 0)
GameObject.Destroy(this.gameObject);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment