Exemple #1
0
    IEnumerator moveAITime(float time)
    {
        Vector2 point = Vector2.zero;

        if (gameBoard.boardEmptySquares() > 25)
        {
            point = bestPoint();
        }
        else
        {
            point = gameMTCS.getPoint();
            if (point.x == 0 && point.y == 0)
            {
                point = bestPoint();
            }
        }

        yield return(new WaitForSeconds(time));

        gameBoard.markArea((int)point.x, (int)point.y, "0");
        gameBoard.boardInteractable = true;
        if (!gameBoard.isWinner("AI"))
        {
            gameUI.updateInfo("X");
        }
        else
        {
            gameUI.updateInfo("X");
            gameUI.gameOverUpdateText("AI");
            gameUI.showRestartButton();
            gameUI.updateWinRate("AI");
            gameUI.gameOverShowAd();
        }
    }