Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Karel on April 29, 2014, 04:14:34 AM

Title: UITexture - how does it render its textures in the Scene View?
Post by: Karel on April 29, 2014, 04:14:34 AM
I'm working on a sprite system for my game, and I want to display different textures for different objects in the Scene View, without having to make new Materials for every texture. This is pretty much what UITexture does for NGUI, and I've been digging through the code to figure out how UITexture does this. I can't find the actual rendering code though, so I'm wondering if you could give me some pointers?

So basically what I want is to be able to assign a texture in the inspector, and then see the new texture displayed in the Scene View, without having to make a temporary material (which causes leaks and warnings about these leaks). Any pointers would be greatly appreciated!
Title: Re: UITexture - how does it render its textures in the Scene View?
Post by: ArenMook on April 29, 2014, 01:38:36 PM
You should be looking at UIDrawCall, not UITexture. That's where materials are created. NGUI needs to create multiple materials to draw things in the proper order.