Example #1
0
    public void InitNextRound()
    {
        CurrentPlayerIndex += 1;

        if ((FindObjectsOfType <SceneItem>().Length <= 0 && CurrentRound > 0) && !PlayersGotItemsToHide())
        {
            // NO MORE BJECTS
            Debug.LogWarning("NO MORE OBJECTS");
            canvas.SetActive(true);
            ScoreUIObject.GetComponent <Canvas>().enabled = true;
            ScoreUIObject.enabled = true;

            return;
        }

        if (CurrentPlayerIndex < Players.Count)
        {
            CurrentPlayer = Players[CurrentPlayerIndex];

            canvas.SetActive(true);
            PlayerStartUI.UpdateContent();
            PlayerStartUI.GetComponent <Canvas>().enabled = true;
        }
        else
        {
            CurrentRound += 1;

            Debug.Log("CurrentRound: " + CurrentRound);

            if (CurrentRound >= RoundNumber)
            {
                canvas.SetActive(true);
                ScoreUIObject.GetComponent <Canvas>().enabled = true;
                ScoreUIObject.enabled = true;
            }
            else
            {
                CurrentPlayerIndex = -1;
                InitNextRound();
            }
        }
    }