UBS Asset Management has purchased the Quartermile 2 office building in Edinburgh from Swiss-based fund AFIAA for £28.5m.