It's an interesting question. I don't think the anri-immigrant rhetoric was that significant. I know to many remain voters it was - many wanted to characterise leave voters as being obsessed with it, but all the evidence points to it being about control, of laws, the economy, immigration, everything. I think that's fair enough.
We also know "the economy" was the biggest issue for Remain voters, so we can also speculate on whether they would have got to 48% without the injection of fear into peoples minds, with the stock market collapse, house price collapse, huge recession etc.
In practice, I think the biggest issue was that 2009-2016 was a difficult time. Austerity, global recession, high immigration and the like, and people were fed up and wanted to lash out. "Take back control" is a very powerful concept. It is the same theme that Drakeford plays on with Westminster and is obviously the core plank of the SNPs policies too.
I think The Remain campaign made a few mistakes. There was a lot of what I would call snobbery online and I think most felt they went too far with project fear. More than anything, people just wanted change. Will it make much difference? I don't think so, although I do agree in principle that laws should be made here. I also think that people want change in the UK now and we will have a new government soon, but again, I doubt it will make much difference to people's lives.