示例#1
0
    private void PlacePiece(Type type, Color color, TileManager tile, float rotation = 0)
    {
        //Create the piece
        Piece piece = new Piece(type, color, Instantiate(piecePrefabs[PrefabID(type, color)], tile.position, Quaternion.Euler(0, rotation, 0)) as GameObject);

        //Place it on the tile
        if (tile.CanPlace(piece))
        {
            if (type == Type.Influence)
            {
                tile.influence.Add(piece);
            }
            else
            {
                tile.pieces.Add(piece);
            }
        }
        ReArrange(tile);
    }