Exemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         // opens a scene
         if (shouldChangeScene)
         {
             trans.ChangeSceneTransition(sceneName);
         }
         else if (shouldQuitGame)    // quits the game if true on the portal
         {
             Application.Quit();
         }
         else    // opens a ui element if set
         {
             UI.SetActive(true);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Changes scene to the main menu with a transition
 /// </summary>
 public void ToMenu()
 {
     sceneTrans.ChangeSceneTransition("Main Menu");
 }
 private void EndGame()
 {
     trans.ChangeSceneTransition("Win Scene");
 }