SHARE
TWEET

[SerializeField] 1

Tarodev Jan 29th, 2020 (edited) 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Hero : MonoBehaviour {
  2.     public float Health; // This will now be visible in the inspector
  3.  
  4.     public void TakeDamage(float dmg) {
  5.         Health -= dmg;
  6.         if(Health <= 0) Die();
  7.     }
  8.  
  9.     private void Die() {
  10.         // Make gurgling noises and die dramatically
  11.     }
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top