Author Topic: Is there a way to disable auto-replacement of UITexture with UISprite?  (Read 1803 times)

bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
Quite simple and straightforward problem: I have noticed that some of the textures in my scenes are sometimes automatically converted to UISprites if the sprites they are using are present in some atlas. I guess it's a helpful optimization that saves time in some use cases (e.g. design a UI with a scattered collection of texture files, generate an atlas from what you actually ended up using, get whole scene instantly converted to properly use it), but in some other use cases it's unfortunately harmful: in particular, when you are using UITexture to allow custom shading of a particular UI element (for example, when you use UITexture with a custom GrabPass based UI shader for semi-transparent blurry window backgrounds).

So, is there a way to disable that option?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is there a way to disable auto-replacement of UITexture with UISprite?
« Reply #1 on: August 22, 2014, 03:14:49 AM »
Comment out line 1059 of UIAtlasMaker.cs:
  1. //NGUIEditorTools.UpgradeTexturesToSprites(NGUISettings.atlas);