Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Hero : MonoBehaviour {
- public float Health; // This will now be visible in the inspector
- public void TakeDamage(float dmg) {
- Health -= dmg;
- if(Health <= 0) Die();
- }
- private void Die() {
- // Make gurgling noises and die dramatically
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement