Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var health1 : Texture2D;
- var health2 : Texture2D;
- var health3 : Texture2D;
- var bodyPart1 : Transform;
- var bodyPart2 : Transform;
- static var LIVES = 3;
- static var HITS = 0;
- function Update ()
- {
- print("Lives: "+LIVES+" Hits: "+HITS); //lives: 3 hits: 0
- switch(LIVES)
- {
- case 3:
- guiTexture.texture = health3;
- break;
- case 2:
- guiTexture.texture = health2;
- break;
- case 1:
- guiTexture.texture = health1;
- break;
- case 0:
- //gameover script here
- break;
- }
- switch(HITS)
- {
- case 1:
- bodyPart2.renderer.enabled=false;
- break;
- case 2:
- bodyPart1.renderer.enabled=false;
- break;
- case 3:
- LIVES -= 1;
- HITS = 0;
- MoveAround.dead = true;
- bodyPart2.renderer.enabled=true;
- bodyPart1.renderer.enabled=true;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement