Example #1
0
 void switchToPrev()
 {
     if (prev != null)
     {
         active = false;
         control.setVisible(false);
         CarControl cc = (CarControl)prev.GetComponent(typeof(CarControl));
         cc.Active();
     }
     else
     {
         Chooser.DestroyMaps();
         SceneManager.LoadScene(0);
     }
 }
Example #2
0
 private void OnGUI()
 {
     if (car.GetComponent <CarAI>().HasFinished())
     {
         if (UnityEngine.GUI.Button(new Rect(Screen.width / 2 - 50, 25, 100, 25), "Back"))
         {
             Chooser.DestroyMaps();
             SceneManager.LoadScene(0);
         }
         if (UnityEngine.GUI.Button(new Rect(Screen.width / 2 - 50, 75, 100, 25), "Replay"))
         {
             car.GetComponent <CarAI>().replay();
         }
         if (UnityEngine.GUI.Button(new Rect(Screen.width / 2 - 50, 125, 100, 25), "Retry"))
         {
             car.GetComponent <CarAI>().retry();
         }
     }
 }