- Home /
Change assets after build?
Hi,
I have several sprites (Resources/Backgrounds/*.png) that I load via "Resuorces.Load" at runtime. I want to make these customizable for the user, so that he can change these sprites without having Unity/Rebuilding.
Now, everything that is in the resources folder is packed inside the "resources.assets", which means that this is not possible on default.
I've read some other questions and answers, but never really read a clear answer. It sounds like I could use AssetBundles, but they sound a bit too much for what I'm trying to do - and I also just want to load the files locally.
Thanks!
Use the WWW class with a local address :
WWW example : http://answers.unity3d.com/questions/432655/loading-texture-file-from-pngjpg-file-on-disk.html
WWW with local address : http://answers.unity3d.com/questions/14587/load-texture-at-run-time-from-file.html
Another method : http://answers.unity3d.com/questions/541258/load-material-texture-from-file.html
Thank you! Still had to "convert" the image to a Sprite using Sprite.Create, but it worked great!