Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var hearfive : Texture2D;
- var hearfour : Texture2D;
- var heartre : Texture2D;
- var heartwo : Texture2D;
- var hearone : Texture2D;
- var health : float = 5;
- function Update() {
- if(Input.GetButtonUp("Jump")) {
- health -= 1;
- }
- if (health >= 5) {
- guiTexture.texture = hearfive;
- }
- if (health >= 4) {
- guiTexture.texture = hearfour;
- }
- if (health >= 3) {
- guiTexture.texture = heartre;
- }
- if (health >= 2) {
- guiTexture.texture = heartwo;
- }
- if (health >= 1) {
- guiTexture.texture = hearone;
- }
- }
- function OnMouseDown(){
- Debug.Log("clicked");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement