void Update()
    {
        if (ST == null)
        {
            Debug.Log("looking for Scene Tracker");
            ST = FindObjectOfType <SceneTracker>();
        }
        else
        {
            if (ST.GetUsedEscape() == false)
            {
                ST.SetFastSkipMainMenu(true);
                ST.SetUsedEscape(true);
                SceneManager.LoadScene("FightingScene");
            }
            else
            {
                ST.SetFastSkipMainMenu(false);
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }
    }
 private void Awake()
 {
     ST = FindObjectOfType <SceneTracker>();
     if (ST != null)
     {
         if (ST.GetUsedEscape() == false)
         {
             ST.SetFastSkipMainMenu(true);
             ST.SetUsedEscape(true);
             SceneManager.LoadScene("FightingScene");
         }
         else
         {
             ST.SetFastSkipMainMenu(false);
         }
     }
 }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (ST == null)
        {
            ST = FindObjectOfType <SceneTracker>();
        }
        //session must be tracking in order access the frame
        if (Session.Status != SessionStatus.Tracking)
        {
            int lostTrackingSleepTimeout = 15;
            Screen.sleepTimeout = lostTrackingSleepTimeout;
            return;
        }
        //if we are tracking check if screen is touched
        if (!planeSet)
        {
            ProcessTouches();
        }
        else
        {
            if (GameObject.FindGameObjectsWithTag("Plane").Length > 0)
            {
                OnTogglePlanes(false);
            }
        }

        if (gameOver)
        {
            GameOverTouches();
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            ST.SetUsedEscape(true);
            ST.SetFastSkipMainMenu(false);
            Time.timeScale = 1f;
            restartGameAudio.Play();
            Invoke("RestartGame", 0.8f);
        }

        /*
         * if(playerDead)
         * {
         *  gameOverUI.SetActive(true);
         * }
         */
        /*
         * if (Input.GetKeyDown(KeyCode.Escape))
         * {
         *  if(paused)
         *  {
         *      Time.timeScale = 1f;
         *      pauseMenu.SetActive(false);
         *  }
         *  else
         *  {
         *      Time.timeScale = 0f;
         *      pauseMenu.SetActive(true);
         *  }
         *  /*
         *  ST.SetUsedEscape(true);
         *  ST.SetFastSkipMainMenu(false);
         *  Time.timeScale = 1f;
         *  SceneManager.LoadScene("MainMenu");
         * }
         */
    }