Пример #1
0
    private void CreateChessman(Chessman.Types cmType, Chessman.Colours cmColour, Vector2Int newCoords)
    {
        GameObject newPiece = Instantiate(chessmanPrefab, Vector3.zero, Quaternion.identity);

        newPiece.transform.position = new Vector3(0, 0, Chessman.chessmanZ);
        Chessman newChessman = newPiece.GetComponent <Chessman>();

        newChessman.Type   = cmType;
        newChessman.Colour = cmColour;
        newChessman.SetBoardPos(newCoords);
        Chess.AddPieceToMatrix(newPiece);
        newChessman.ActivateSprite();
    }