コード例 #1
0
    public void     NextTurn()
    {
        if (CheckGameEnd(1))
        {
            return;
        }
        if (CheckGameEnd(2))
        {
            return;
        }
        if (CheckTie())
        {
            return;
        }

        ourUI.RefreshScoreText(player1.Name, player2.Name, wins, ties, loses);

        if (crossTurn)
        {
            print("X Turn");
            if (player1.playerNum == 1)
            {
                ourUI.RefreshTurnText(player1.Name, 1, true);
                player1.MakeTurn();
            }

            else
            {
                ourUI.RefreshTurnText(player2.Name, 1, false);
                player2.MakeTurn();
            }
        }
        else
        {
            print("O Turn");
            if (player1.playerNum == 2)
            {
                ourUI.RefreshTurnText(player1.Name, 2, true);
                player1.MakeTurn();
            }
            else
            {
                ourUI.RefreshTurnText(player2.Name, 2, false);
                player2.MakeTurn();
            }
        }
    }