title: Making a Texture2D readable in Unity via code
body: <p>I have some AssetBundles that I want to convert to .png image files.</p>
  
  <p>They are Texture2D assets, but the problem is as they are not Read Enable, when 
  I try to convert them to PNG with a </p>
  
  <pre><code>var _bytes = _texture2d.EncodeToPNG();
  </code></pre>
  
  <p>command, I get the following error message:</p>
  
  <blockquote>
    <p><em>Texture 'name of a texture' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the
    Texture Import Settings.</em></p>
  </blockquote>
  
  <p>I really can't access the Texture Import Settings, as they come from asset bundles and everything is made with code.</p>
  
  <p>Somebody has a workaround for this?</p>
  
  <p>Thanks</p>