Advertisement
aandnota

HealthKeeper

Feb 7th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var textMesh:TextMesh;
  2. var health = 0;
  3. var healthkeeper : HealthKeeper;
  4.  
  5. function Start (){
  6.      healthkeeper = GameObject.FindObjectOfType(HealthKeeper);
  7. }
  8.  
  9. function Awake () {
  10.     textMesh = GetComponent(TextMesh);
  11. }
  12.  
  13. function AddToHealth(){
  14.     ++health;
  15.     textMesh.text = "" + health;
  16. }
  17.  
  18. function SubtractHelath(){
  19.     --health;
  20.     textMesh.text = "" + health;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement