- Home /
How do I get file size of texture?
I want to find out (at runtime) how big a Texture2D is. I'm looking to cache a certain number of em, but I want to have a cap on the amount of Textures cached for obvious reasons. How do I go about this?
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by hiddenspring81 · May 30, 2013 at 05:59 PM
Depends on what you mean by "size". Do you mean file size? If so, use Profiler.GetRuntimeMemorySize(), which will return the amount of memory consumed by the asset. Note that this will work not only for textures, but for any asset in the game.
Yes, I was looking for size in memory. Thanks, this is what I was looking for!
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                