Advertisement
N1warhead

GUI System

Sep 20th, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. // THIS IS THE SCRIPT FOR THE HUD OF THE GAMEOBJECT.
  2. //ATTACH THIS TO YOUR GAMEOBJECT YOU WANT AS A HUD.
  3.  
  4.  
  5. using UnityEngine;
  6. using System.Collections;
  7.  
  8. public class Health1 : MonoBehaviour {
  9. // Access Health Script
  10. public BasicHealth healthScript;
  11.  
  12. // Use this for initialization
  13. void Start () {
  14. }
  15. // Update is called once per frame
  16. void Update () {
  17.  
  18. // If health is lower than this Then, disable Mesh Renderer.
  19. if (healthScript.curHealth <= 9) {
  20. renderer.enabled = false;
  21. }
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement