Пример #1
0
        public void addWhitePawn(Vector2Int pos)
        {
            GameObject temp = Instantiate(whitePawnPrefab) as GameObject;

            temp.transform.position = Assets.BoardHandler.toWorldPos(pos.x, pos.y);
            Figure fig = temp.AddComponent <Figure>() as Figure;

            fig.VectorMoves     = FigureMover.getWhitePawnVectorMoves();
            fig.AttackMoves     = FigureMover.getWhitePawnAttackMoves();
            fig.team            = Team.WHITE;
            fig.Type            = TypeFigure.Pawn;
            board[pos.x, pos.y] = temp;
        }
Пример #2
0
        public void addBlackKing(Vector2Int pos)
        {
            GameObject temp = Instantiate(blackKingPrefab) as GameObject;

            temp.transform.position = Assets.BoardHandler.toWorldPos(pos.x, pos.y);
            Figure fig = temp.AddComponent <Figure>() as Figure;

            fig.Moves           = FigureMover.getKingMoves();
            fig.VectorMoves     = null;
            fig.AttackMoves     = null;
            fig.team            = Team.BLACK;
            fig.Type            = TypeFigure.King;
            board[pos.x, pos.y] = temp;
        }