Author Topic: UITexture - how does it render its textures in the Scene View?  (Read 2341 times)

Karel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
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!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture - how does it render its textures in the Scene View?
« Reply #1 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.