예제 #1
0
        private void initField()
        {
            for (int x = 0; x < 8; x++)
            {
                for (int y = 0; y < 8; y++)
                {
                    field [x, y] = new BoardSquare(fieldStartSquare.transform.position + new Vector3(x * squareSize, 0, -y * squareSize));
                }
            }

            createNewPiece(field [3, 3], false);
            createNewPiece(field [4, 3], true);
            createNewPiece(field [3, 4], true);
            createNewPiece(field [4, 4], false);
        }
예제 #2
0
 private void createNewPiece(BoardSquare square, bool white)
 {
     square.piece = Instantiate(piecePrefab, square.position, Quaternion.identity).GetComponent <OthelloPiece>();
     square.piece.setColor(white);
 }