This has been a bit frustrating, but likely a simple question. I’m using the correct name spaces, but it just keeps telling me I can’t use anything with “File.”
It will let me use System.IO.File.Create though, Does that work the same way? I’m basically just wanting to save some images on the user’s device so they don’t have to download them every time they see them.
Here snippet for you
FileStream fls = new FileStream (Application.persistentDataPath + "/yourOwnPath/" + "nameOfFile.jpg", FileMode.Create);
fls.Write (www.bytes, 0, www.bytes.Length); //same for any byte array, just replace "www.bytes" with your variable
AND one more:
I’m basically just wanting to save
some images on the user’s device so
they don’t have to download them every
time they see them.
Use asset bundles, if you download picture from www, and then save it, then at another game start app need to use again www to “download” picture from device, it’s bad. Still if your game doesnt have 100 downloading objects at same time, you can use your way without fear for perfomance