|
While this question is probably not Unity specific ... In my game I would like use www class to import texture2D. After they are downloaded and in use what is the suggested method to cache/persist these graphics for future use. Is sqlite overkill? iByte Based on SpikeX question below I have added the following information: My game will ship with a specific set of graphics. I want these graphics to be updateble over the web (the amount of space required would not change). When the player closes the game I don't want the new graphics to turn into dispersed electrons. I want the graphics to be reloaded into the game (locally) when it starts up again. It would be okay if the original graphics were overwritten if there was a way to do that. If not then I am assuming I need some kind of file storage file or simple blob like database to keep them in. I would hope to support any type of Unity deployment target with whatever solution was used.
(comments are locked)
|
|
You can save downloaded textures with the usual http://System.IO functions, such as WriteAllBytes, plus the use of Application.DataPath. Note that this only works with standalones; you can't cache anything locally with webplayers, aside from 1MB of PlayerPrefs data. (Unless you get a special license from UT that allows caching in webplayers.) Note that from Unity3.3 you can use Application.persistentDatapath. This works on all devices (except web); see http://www.previewlabs.com/file-io-in-unity3d/
May 19 '11 at 12:29 PM
bernardfrancois
Does this also work for mobile? Or do you just save that in PlayerPrefs
Dec 19 '11 at 03:26 AM
ina
(comments are locked)
|

"In my game I would like use www class to import texture2D."
Could you be a little more specific? Typically with games you just have an asset database that everything grabs from, and is packaged with your game. Unity also handles automatic streaming of web content using the web player if that's what you're trying to do.