Legacy Documentation: Version 4.6.2
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

TextureImporter

Namespace: UnityEditor

/

Inherits from: AssetImporter

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Texture importer lets you modify Texture2D import settings from editor scripts.

Settings of this class match the ones exposed in Texture Import Settings.

Variables

anisoLevel Anisotropic filtering level of the texture.
borderMipmap Keep texture borders the same when generating mipmaps?
compressionQuality Quality of Texture Compression in the range [0..100].
convertToNormalmap Convert heightmap to normal map?
fadeout Fade out mip levels to gray color?
filterMode Filtering mode of the texture.
generateCubemap Cubemap generation mode.
generateMipsInLinearSpace Should mip maps be generated with gamma correction?
grayscaleToAlpha Generate alpha channel from intensity?
heightmapScale Amount of bumpyness in the heightmap.
isReadable Is texture data readable from scripts.
lightmap Is this texture a lightmap?
linearTexture When in linear rendering should this texture be sampled with hardware gamma correction (sRGB) or without (linear)?
maxTextureSize Maximum texture size.
mipMapBias Mip map bias of the texture.
mipmapEnabled Generate mip maps for the texture?
mipmapFadeDistanceEnd Mip level where texture is faded out completely.
mipmapFadeDistanceStart Mip level where texture begins to fade out.
mipmapFilter Mipmap filtering mode.
normalmap Is this texture a normal map?
normalmapFilter Normal map filtering mode.
npotScale Scaling mode for non power of two textures.
qualifiesForSpritePacking Returns true if this TextureImporter is setup for Sprite packing.
spriteBorder Border sizes of the generated sprites.
spriteImportMode Selects Single or Manual import mode for Sprite textures.
spritePackingTag Selects the Sprite packing tag.
spritePivot The point in the Sprite object's coordinate space where the graphic is located.
spritePixelsPerUnit The number of pixels in the sprite that correspond to one unit in world space.
spritesheet Array representing the sections of the atlas corresponding to individual sprite graphics.
textureFormat Format of imported texture.
textureType Which type of texture are we dealing with here.
wrapMode Wrap mode (Repeat or Clamp) of the texture.

Functions

ClearPlatformTextureSettings Clear specific target platform settings.
DoesSourceTextureHaveAlpha Does textures source image have alpha channel.
DoesSourceTextureHaveColor Does textures source image have RGB channels.
GetPlatformTextureSettings Get platform specific texture settings.
ReadTextureImportInstructions Reads the active texture output instructions of this TextureImporter.
ReadTextureSettings Read texture settings into TextureImporterSettings class.
SetPlatformTextureSettings Set specific target platform settings.
SetTextureSettings Set texture importers settings from TextureImporterSettings class.

Inherited members

Variables

assetPath The path name of the asset for this importer. (Read Only)
userData Get or set any user data.
hideFlags Should the object be hidden, saved with the scene or modifiable by the user?
name The name of the object.

Functions

GetInstanceID Returns the instance id of the object.
ToString Returns the name of the game object.

Static Functions

GetAtPath Retrieves the asset importer for the asset at path.
Destroy Removes a gameobject, component or asset.
DestroyImmediate Destroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoad Makes the object target not be destroyed automatically when loading a new scene.
FindObjectOfType Returns the first active loaded object of Type type.
FindObjectsOfType Returns a list of all active loaded objects of Type type.
Instantiate Clones the object original and returns the clone.

Operators

bool Does the object exist?
operator != Compares if two objects refer to a different object.
operator == Compares if two objects refer to the same.