示例#1
0
    public void RestartFromThreatLevel()
    {
        StaticClearer.ClearAll();
        int index = FindObjectOfType <RoundController>().CurrectRoundIndex;

        FindObjectOfType <LoadSettingsOnStartUp>().StartUpThreatLevel = index / 5;
        RestartGame();
    }
示例#2
0
    public void QuitToMainMenu()
    {
        StaticClearer.ClearAll();

        if (MenuManager.Instance)
        {
            MenuManager.Instance.CloseAllMenus();
            GameObject go = MenuManager.Instance.gameObject;
            Destroy(go);
        }

        int sceneToMoveTo = SceneManager.GetActiveScene().buildIndex - 1;

        if (sceneToMoveTo >= 0)
        {
            SceneManager.LoadScene(sceneToMoveTo);
        }
        else
        {
            UnityEngine.Debug.Log("There is no scene assigned in build settings!");
        }
    }
示例#3
0
 public void RestartGame()
 {
     StaticClearer.ClearAll();
     MenuManager.Instance.CloseAllMenus();
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }