Пример #1
0
    public void PlacePiece(Vector2Int gridPoint, GameObject boardSection)
    {
        var playerNumber = CurrentPlayer.PlayerNumber;

        if (!Grid.PlacePiece(playerNumber, gridPoint.y, gridPoint.x))
        {
            return;
        }

        var position    = Geometry.PointFromGrid(gridPoint);
        var rotation    = Quaternion.identity;
        var piecePrefab = CurrentPlayer.PiecePrefab;
        var newPiece    = Instantiate(piecePrefab, position, rotation);

        newPiece.transform.parent = boardSection.transform;

        if (!CheckWinner())
        {
//            NextPlayer();
            NextRotation();
        }
    }