Beispiel #1
0
    private void EndRound()
    {
        for (int i = 0; i < players.Count; i++)
        {
            if (players[i].isTagger)
            {
                players[i].Eliminate();
                players.Remove(players[i]);
            }
        }

        if (players.Count > 1)
        {
            StartRound();
        }
        else
        {
            state = GameState.FINISHED;
            print($"{players[0]} won");
            if (players[0] != null)
            {
                string winner = players[0].pV.Owner.NickName;
                Destroy(players[0].gameObject);
                voteCam.SetActive(true);
                voteSystem.PhotonStartVoting();
                if (PhotonNetwork.IsMasterClient)
                {
                    voteSystem.SetWinner(winner);
                }
            }
        }
    }
Beispiel #2
0
    public void EndGameForEveryone(string winner)
    {
        PlayerController[] players = FindObjectsOfType <PlayerController>();
        for (int i = 0; i < players.Length; i++)
        {
            Destroy(players[i].gameObject);
        }
        voteCam.SetActive(true);
        voteSystem.PhotonStartVoting();

        if (PhotonNetwork.IsMasterClient)
        {
            voteSystem.SetWinner(winner);
        }
    }
Beispiel #3
0
    void EndGame(string winner)
    {
        PlayerController[] players = GameObject.FindObjectsOfType <PlayerController>();
        for (int i = 0; i < players.Length; i++)
        {
            players[i].Eliminate();
        }

        voteObj.SetActive(true);
        voteSystem.PhotonStartVoting();

        if (PhotonNetwork.IsMasterClient)
        {
            voteSystem.SetWinner(winner);
        }
    }