Exemplo n.º 1
0
    public void ReturnToMenu()
    {
        StopAllCoroutines();

        StartNewRound();

        ManagerFunctions.ResetSpawnPoints(Spawns);

        NameManager.Instance.InitNames();

        ScoreManager.Instance.ClearScores();

        Camera MainCamera = GameObject.FindObjectOfType <Camera>();

        DestroyTanks();

        PauseMenu.SetActive(false);

        MenuCanvas.SetActive(true);
        MainMenu.SetActive(true);
        ConfigMenu.SetActive(false);
    }
Exemplo n.º 2
0
    private IEnumerator GameEnding()
    {
        //// As soon as the round begins playing let the players control the tanks.
        ManagerFunctions.ResetSpawnPoints(Spawns);

        NameManager.Instance.InitNames();

        ManagerFunctions.EnableScoreBoard(true, ScorePanel);

        ScoreManager.Instance.ClearScores();

        StartNewRound();

        PlayerScore[] TankScores = GameObject.FindObjectsOfType <PlayerScore>();

        PlayerScore WinningTank = TankScores[0];

        foreach (PlayerScore S in TankScores)
        {
            if (S.Score > WinningTank.Score)
            {
                WinningTank = S;
            }
        }

        MessageText.text = WinningTank.GetComponent <PlayerName>().GetCurrentName() + " WINS";

        WinningTank.gameObject.transform.position = new Vector3(0.0f, 1.0f, 0.0f);

        Camera MainCamera = GameObject.FindObjectOfType <Camera>();

        MainCamera.GetComponent <Animator>().SetTrigger("WinIn");

        MenuButton.SetActive(true);

        StopAllCoroutines();

        yield return(null);
    }