Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var ShowButton : boolean = false;
- // Use this for initialization
- function Start () {
- }
- // Update is called once per frame
- function Update () {
- }
- function OnCollisionEnter(other : Collision){
- if (other.gameObject.tag == "Player") {
- Time.timeScale = 0;
- ShowButton = true;
- }
- }
- function OnGUI (){
- if(ShowButton){
- if(GUI.Button(Rect(25, 25, 100, 30),"Retry")){
- Application.LoadLevel(Application.loadedLevel);
- Time.timeScale = 1;
- ShowButton = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement