TextureImporter 纹理导入器
Inherits from AssetImporter
Texture importer lets you modify Texture2D import settings from editor scripts.
TextureImporter让你从编辑器脚本修改Texture2D导入设置。
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.
注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。
Settings of this class match the ones exposed in Texture Import Settings.
这个类的设置匹配暴露在Texture Import检视面板中的设置。
Variables变量
- textureFormatFormat of imported texture.
被导入纹理的格式。 - maxTextureSizeMaximum texture size.
最大纹理大小。 - grayscaleToAlphaGenerate alpha channel from intensity?
从灰度生成alpha通道? - generateCubemapCubemap generation mode.
立方图生成模式。 - npotScaleScaling mode for non power of two textures.
用于非二次幂纹理的缩放模式。 - isReadableIs texture data readable from scripts.
纹理数据从脚本是否可读? - mipmapEnabledGenerate mip maps for the texture?
用于纹理,生成mipmap? - borderMipmapKeep texture borders the same when generating mipmaps?
当生成mipmap时,保持纹理边框相同? - correctGammaShould mip maps be generated with gamma correction?
应否生成mipmap带有伽玛校正? - mipmapFilterMipmap filtering mode.
Mipmap过滤模式。 - fadeoutFade out mip levels to gray color?
淡出mip级别到灰色? - mipmapFadeDistanceStartMip level where texture begins to fade out.
Mip级别,在哪里纹理开始淡出。 - mipmapFadeDistanceEndMip level where texture is faded out completely.
Mip级别,在哪里纹理完全淡出。 - convertToNormalmapConvert heightmap to normal map?
转换高度图到法线贴图? - normalmapIs this texture a normal map?
转换高度图到法线贴图? - normalmapFilterNormal map filtering mode.
法线贴图过滤模式。 - heightmapScaleAmount of bumpyness in the heightmap.
高度图中的凹凸数。 - lightmapIs this texture a lightmap?
这个纹理是光照贴图么? - anisoLevelAnisotropic filtering level of the texture.
纹理的各向异性过滤等级。 - filterModeFiltering mode of the texture.
纹理的过滤模式。 - wrapModeWrap mode (Repeat or Clamp) of the texture.
纹理的循环模式。 - mipMapBiasMip map bias of the texture.
纹理的Mip map偏移值。 - textureTypeWhich type of texture are we dealing with here
在这里处理,纹理是哪种类型。
Functions函数
- GetPlatformTextureSettingsGet platform specific texture settings
获取平台特定的纹理设置。 - SetPlatformTextureSettingsSet specific target platform settings
设置特定目标平台纹理设置。 - ClearPlatformTextureSettingsClear specific target platform settings
清除特定目标平台纹理设置。 - DoesSourceTextureHaveAlphaDoes textures source image have alpha channel.
源纹理的图像是否有alpha通道。 - ReadTextureSettingsRead texture settings into TextureImporterSettings class.
在TextureImporterSettings类读取纹理设置。 - SetTextureSettingsSet texture importers settings from TextureImporterSettings class.
从TextureImporterSettings类,设置纹理导入设置。
Inherited members继承成员Inherited Variables继承变量
- assetPathThe path name of the asset for this importer (Read Only)
用于这个导入器,资源的路径名(只读)。
- nameThe name of the object. //物体的名字
- hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
物体是否被隐藏、保存在场景中或被用户修改?
Inherited Functions继承函数
- GetInstanceIDReturns the instance id of the object.
返回物体的实例ID - ToStringReturns the name of the game object.
返回游戏物体的名称。
Inherited Class Functions继承类函数
- GetAtPathRetrieves the asset importer for the asset at path.
为所在路径的资源,导入器重新获取资源。
- DestroyRemoves a gameobject, component or asset.
删除一个游戏物体、组件或资源 - DestroyImmediateDestroys the object obj immediately. It is strongly recommended to use Destroy instead.
立即销毁物体obj,强烈建议使用Destroy代替。 - DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
加载新场景的时候使目标物体不被自动销毁。 - FindObjectOfTypeReturns the first active loaded object of Type type.
返回Type类型第一个激活的加载的物体。 - FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
返回Type类型的所有激活的加载的物体列表 - InstantiateClones the object original and returns the clone.
克隆原始物体,并返回克隆的物体