Assets/Scripts/BoardManager.cs
/// <summary>
/// spawn a certain piece in the board at a certain position
/// each piece follows chess notation
/// </summary>
spawn a certain piece in the board at a certain position
each piece follows chess notation
spawn a certain piece in the board at a certain position each piece follows chess notation
public void SpawnPiece(int x, int z, string piece)
    {
        int indexInModelsArray = convertPieceNotationToIndex(piece);
        GameObject go = Instantiate(chessPiecesModels[indexInModelsArray], GetTileCenter(x, z), Quaternion.Euler(0, 90, 0)) as GameObject;
        go.transform.SetParent(transform);
        chessPieces[x, z] = go.GetComponent<ChessPiece>();
        chessPieces[x, z].setPosition(x, z);
        activeChessPieceModel.Add(go);
    }
public void SpawnPiece ( int x , int z , string piece ) { int indexInModelsArray = convertPieceNotationToIndex ( piece ) ; GameObject go = Instantiate ( chessPiecesModels [ indexInModelsArray ] , GetTileCenter ( x , z ) , Quaternion . Euler ( 0 , 90 , 0 ) ) as GameObject ; go . transform . SetParent ( transform ) ; chessPieces [ x , z ] = go . GetComponent < ChessPiece > ( ) ; chessPieces [ x , z ] . setPosition ( x , z ) ; activeChessPieceModel . Add ( go ) ; }
spawn a certain piece in the board at a certain position
each piece follows chess notation
spawn a certain piece in the board at a certain position each piece follows chess notation
//GameObject go = Instantiate(chessPiecesModels[indexInModelsArray], GetTileCenter(x, z - 1), Quaternion.identity) as GameObject;
x
int
z
int
piece
string