How get native texture size??

When i import texture in Unity, texture importer change size of texture to near degree of 2. That is well, but i want know source texture file dimensions in editor script, how get native width and height of texture file??

Select your texture in the Project, and then go to the inspector. Click on "Texture Type" and select advanced. First step

Select "Non Power Of Two" and select None. Second step

This will stop the texture from being resized to a power of two. This can be slightly slower.

You can adjust even more settings here.


You will get the texture width and height given the settings you have for that texture.

If you don't want the texture to be forced to power of two sizes, select advanced in the texture type and then you have full control and can keep the original size.