Search Unity

Access platform's compressed texture size through script?

Discussion in 'Asset Bundles' started by DGordon, Nov 19, 2019.

  1. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey all,

    I want to grab the compressed file size for textures that Unity displays in the inspector thumbnail. How do I access that? It obviously exists, since Unity is displaying it ... I just want to be able to display the _same_ data somewhere else.

    We have an automated system for creating asset bundles for our webgl builds from specific folders. I just want to loop through all the textures in those folders, and display their compressed file sizes in one of our editors. It doesn't matter to me if its not the final size in the build logs (I already have an editor dealing with that)-- I just want that same data that is already being displayed. It would be tremendously helpful to us if I could auto-detect any files over X size, allow us to select them right there, etc etc. Essentially, do exactly what the editor already lets us do on a file-by-file basis, but it would allow me to give us that same data in a _much_ more efficient manner, which actually would allow us to use it to problem-solve.

    The only issue is ... I can't figure out where to access that data through script!

    PS: I posted this in the Editor forums as well. I don't know where it belongs, since I dont know which forum has people that will both (a) have the knowledge to answer this, and (b) take the time to. We could actually really use an answer to this, are paying customers for many years, and I've personally spent thousands and thousands on assets ... so please don't nuke this if it hasn't actually gotten a response, thanks. I don't have any idea where to go to answer if this is even possible, or one of those internal hidden things that I dont have any . If this is answered in one of the forums, a mod should just delete the other, or something, if it matters ... thanks!
     
    Last edited: Nov 19, 2019
  2. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649