I’m using the WWW class to load some textures from outside of unity, and couldn’t work out why it wasn’t working. I then stumbled across a post that suggested starting the path with “file:///” rather than “file://” as you would normally do. This solved my problem but I have absolutely no idea why, and I really don’t want any code in my game which I don’t completely understand. I would be very grateful if anyone could explain the reason this works.
I haven’t seen file written with only two slashes like that. Opening a file in Firefox yields the three-slashes. You will go crazy if you try and find a logical reason for everything going on in a computer, ultimately all those decisions were made by flawed human-beings.
file is the protocol
:// is the separator
/ is the path.
What might be confusing is in Windows this is still file:///c:/ for the c drive, and this is simply because drives are treated as objects under the root object. In theory this would let you list all drives when you hit file:/// but it doesn’t actually work that way.
On a Mac or any other similar system the file:/// just works as if you open a terminal and hit ‘ls /’.