Esempio n. 1
0
        //public int GetNextPlayerId()
        //{
        //    int result = turnIndex;

        //    result++;
        //    if (result > turns.Length - 1)
        //        result = 0;

        //    return turns[result].player.photonId;
        //}

        //int GetPlayerTurnIndex(int photonId)
        //{
        //    for (int i = 0; i < turns.Length; i++)
        //    {
        //        if (turns[i].player.photonId == photonId)
        //            return i;
        //    }

        //    return -1;
        //}

        //public void ChangeCurrentTurn(int photonId)
        //{
        //    turnIndex = GetPlayerTurnIndex(photonId);
        //    currentPlayer = turns[turnIndex].player;
        //    turns[turnIndex].OnTurnStart();
        //    turnText.value = turns[turnIndex].player.userName;
        //    onTurnChanged.Raise();
        //}

        void SetupPlayers()
        {
            ResourcesManager rm = Settings.GetResourcesManager();

            for (int i = 0; i < all_Players.Length; i++)
            {
                all_Players[i].Init();

                if (i == 0)
                {
                    all_Players[i].currentHolder = playerOneHolder;
                }
                else
                {
                    all_Players[i].currentHolder = otherPlayersHolder;
                }

                all_Players[i].statsUI = statsUIs[i];
                all_Players[i].currentHolder.LoadPlayer(all_Players[i], all_Players[i].statsUI);
            }
        }