Texture importer lets you modify Texture2D import settings from editor scripts.
Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
Settings of this class match the ones exposed in Texture Import Settings.
textureFormat |
Format of imported texture. |
maxTextureSize |
Maximum texture size. |
compressionQuality |
Quality of Texture Compression in the range [0..100] |
grayscaleToAlpha |
Generate alpha channel from intensity? |
generateCubemap |
Cubemap generation mode. |
npotScale |
Scaling mode for non power of two textures. |
isReadable |
Is texture data readable from scripts. |
mipmapEnabled |
Generate mip maps for the texture? |
borderMipmap |
Keep texture borders the same when generating mipmaps? |
linearTexture |
When in linear rendering should this texture be sampled with hardware gamma correction (sRGB) or without (linear)? |
mipmapFilter |
Mipmap filtering mode. |
fadeout |
Fade out mip levels to gray color? |
mipmapFadeDistanceStart |
Mip level where texture begins to fade out. |
mipmapFadeDistanceEnd |
Mip level where texture is faded out completely. |
generateMipsInLinearSpace |
Should mip maps be generated with gamma correction? |
convertToNormalmap |
Convert heightmap to normal map? |
normalmap |
Is this texture a normal map? |
normalmapFilter |
Normal map filtering mode. |
heightmapScale |
Amount of bumpyness in the heightmap. |
lightmap |
Is this texture a lightmap? |
anisoLevel |
Anisotropic filtering level of the texture. |
filterMode |
Filtering mode of the texture. |
wrapMode |
Wrap mode (Repeat or Clamp) of the texture. |
mipMapBias |
Mip map bias of the texture. |
textureType |
Which type of texture are we dealing with here |
GetPlatformTextureSettings |
Get platform specific texture settings |
SetPlatformTextureSettings |
Set specific target platform settings |
ClearPlatformTextureSettings |
Clear specific target platform settings |
DoesSourceTextureHaveAlpha |
Does textures source image have alpha channel. |
DoesSourceTextureHaveColor |
Does textures source image have RGB channels. |
ReadTextureSettings |
Read texture settings into TextureImporterSettings class. |
SetTextureSettings |
Set texture importers settings from TextureImporterSettings class. |
assetPath |
The path name of the asset for this importer (Read Only) |
userData |
Get or set any user data. |
name |
The name of the object. |
hideFlags |
Should the object be hidden, saved with the scene or modifiable by the user? |
GetInstanceID |
Returns the instance id of the object. |
ToString |
Returns the name of the game object. |
GetAtPath |
Retrieves the asset importer for the asset at path. |
operator bool |
Does the object exist? |
Instantiate |
Clones the object original and returns the clone. |
Destroy |
Removes a gameobject, component or asset. |
DestroyImmediate |
Destroys the object obj immediately. It is strongly recommended to use Destroy instead. |
FindObjectsOfType |
Returns a list of all active loaded objects of Type type. |
FindObjectOfType |
Returns the first active loaded object of Type type. |
operator == |
Compares if two objects refer to the same |
operator != |
Compares if two objects refer to a different object |
DontDestroyOnLoad |
Makes the object target not be destroyed automatically when loading a new scene. |