Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to get in the code texture size in MB / KB as in Texture Importer (Inspector).

Discussion in 'Scripting' started by Max-Bot, Oct 12, 2022.

  1. Max-Bot

    Max-Bot

    Joined:
    Sep 25, 2013
    Posts:
    83
    How to get in the code this texture size value as on screenshot (in MB / KB).
    2.7 MB in this example:

    upload_2022-10-12_17-39-7.png

    For base Texture class (Not Texture2D).
    Unity 2020.3.20f1

    Thanks! :)
     
  2. Max-Bot

    Max-Bot

    Joined:
    Sep 25, 2013
    Posts:
    83
    Last edited: Oct 12, 2022
  3. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,043
  4. Max-Bot

    Max-Bot

    Joined:
    Sep 25, 2013
    Posts:
    83
  5. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,043
    Well I'm not sure then if there is a non-hacky way to get it.
     
    Max-Bot likes this.