Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #pragma strict
  2.  
  3. var ShowButton : boolean = false;
  4.  
  5.  
  6. // Use this for initialization
  7. function Start () {
  8.  
  9.  
  10.  
  11. }
  12.  
  13. // Update is called once per frame
  14. function Update () {
  15.  
  16.  
  17.  
  18.  
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. function OnCollisionEnter(other : Collision){
  27.  
  28.  
  29. if (other.gameObject.tag == "Player") {
  30. Time.timeScale = 0;
  31. ShowButton = true;
  32. }
  33.  
  34. }
  35.  
  36. function OnGUI (){
  37. if(ShowButton){
  38. if(GUI.Button(Rect(25, 25, 100, 30),"Retry")){
  39. Application.LoadLevel(Application.loadedLevel);
  40. Time.timeScale = 1;
  41. ShowButton = false;
  42. }
  43.  
  44. }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement