Search Unity

Setting readable flag on textures loaded at runtime?

Discussion in 'Editor & General Support' started by independentcreator, Nov 12, 2009.

  1. independentcreator

    independentcreator

    Joined:
    Aug 31, 2009
    Posts:
    14
    Is there a way to set the Readable flag to true on textures loaded from the Resources directory at runtime?

    In particular: I'm attempting to use Texture2D.PackTextures at runtime. If I do so with the textures I've read from the Resources folder, I get:

    "Texture atlas needs textures to have Readable flag set!"

    There are quite a few textures in the Resources folder, however, and going through and checking a box for hundreds of them is unrealistic. I can't find anything in the documentation about passing a flag to Resources.Load or similar.
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    You cannot change the readable setting at runtime. You could, however, automate the clicking of checkboxes using an editor script, using TextureImporter.isReadable.
     
  3. independentcreator

    independentcreator

    Joined:
    Aug 31, 2009
    Posts:
    14
  4. alok-kr-029

    alok-kr-029

    Joined:
    Jan 10, 2013
    Posts:
    22
    HI I am downloading a texture of type png from server at runtime ,Now I have to add polygon collider and use it.
    its working fine on editor but not for other devices after rnd I found out I have to enable readable and writable at runtime .. is it possible plz help