- Home /
load images in memory
How can i preload some textures in memory to avoid temporal lag in unity3d?
Answer by Karsnen_2 · Jan 08, 2013 at 02:40 PM
Yes, You could. When you say images I think you mean Materials. Try to implement the concept of Pooling.
If you are not aware of pooling, there are a lot of tutorials and help info on answers & on forums. The best tutorial to me, I could find was these two videos from Prime31. Though they do not say it in the title, they converse mostly about it.
http://www.youtube.com/watch?v=LVar0R7mpbc&list=UU_sPqujw2G4TeQVGDRi6F6A∈dex=29
http://www.youtube.com/watch?v=d9078u8ft58&list=UU_sPqujw2G4TeQVGDRi6F6A
i have looked at both videos and there is no reference to preloading materials. In the second video, the idea is more along the line of recycling objects and disabling them when not in use.
Yes.. even that is what I thought it would be helpful for you. So you just load them and then switch it in the transform.renderer.material whenever you need to.
I will try it on monday. Was sick and skipped work. Thanks for the help!
Answer by badescuga9 · Jan 11, 2013 at 04:53 PM
I will try it on monday. Was sick and skipped work. Thanks for the help!