纹理导入器允许您从编辑器脚本修改 Texture2D 导入设置。
此类中的设置与 Texture Import Settings 中显示的设置相匹配。
allowAlphaSplitting | 允许在相关平台上对此纹理进行 Alpha 通道分离。 |
alphaIsTransparency | 如果提供的 Alpha 通道为透明度 (Transparency),则启用此属性可预过滤颜色,从而避免过滤瑕疵。 |
alphaSource | 选择生成导入纹理的 Alpha 的方式。 |
alphaTestReferenceValue | 返回或分配 Alpha 测试参考值。 |
androidETC2FallbackOverride | 不支持 ETC2 的 Android 设备上的 ETC2 纹理解压缩回退重载。 |
anisoLevel | 纹理的各向异性过滤级别。 |
borderMipmap | Keeps texture borders the same when generating mipmaps. |
compressionQuality | 纹理压缩质量,范围为 [0..100]。 |
convertToNormalmap | Converts heightmaps to normal maps. |
crunchedCompression | 使用经过 Crunch 处理的压缩(如果可用)。 |
fadeout | Fades out mip levels to a gray color. |
filterMode | 纹理的过滤模式。 |
generateCubemap | 立方体贴图生成模式。 |
heightmapScale | 高度贴图中的凹凸程度。 |
ignorePngGamma | Ignore the Gamma attribute in PNG files. This property does not effect other file formats. |
isReadable | 如果希望从脚本中读取纹理数据,请将此属性设置为 true。将其设置为 false 可阻止脚本读取纹理数据。 |
maxTextureSize | 最大纹理大小。 |
mipMapBias | 纹理的多级渐进纹理偏差。 |
mipmapEnabled | 生成 MipMap。 |
mipmapFadeDistanceEnd | 纹理完全淡出的 Mip 级别。 |
mipmapFadeDistanceStart | 纹理开始淡出的 Mip 级别。 |
mipmapFilter | Mipmap 过滤模式。 |
mipMapsPreserveCoverage | Enables or disables coverage-preserving alpha mipmapping. |
normalmapFilter | 法线贴图过滤模式。 |
npotScale | 非二次幂纹理的缩放模式。 |
qualifiesForSpritePacking | 如果为精灵打包设置了此 TextureImporter,则返回 true。 |
secondarySpriteTextures | 用于导入的精灵的辅助纹理。 |
spriteBorder | 生成的精灵的边框大小。 |
spriteImportMode | 为精灵纹理选择 Single 或 Manual 导入模式。 |
spritePackingTag | 选择 Sprite 打包标签。 |
spritePivot | 精灵对象坐标空间中图形所在的点。 |
spritePixelsPerUnit | 对应世界空间中一个单位的精灵中的像素数。 |
spritesheet | 用于表示与各精灵图形对应的图集部分的数组。 |
sRGBTexture | Determines whether this texture stores color data. |
streamingMipmaps | 为此纹理启用 Mipmap 串流。 |
streamingMipmapsPriority | 在减小内存大小以达到内存预算时此纹理的相对优先级。 |
textureCompression | 导入纹理的压缩。 |
textureShape | 导入纹理的形状。 |
textureType | 我们现在处理的纹理类型。 |
vtOnly | When enabled, this texture can solely be used in combination with a Texture Stack for Virtual Texturing. When enabled the texture is not guaranteed to be available as a Texture2D in the Player (e.g., not accessible from a script). When disabled, the Player includes the texture both as a Texture2D (e.g., accessible from script) and as a streamable texture in a Texture Stack. |
wrapMode | 纹理坐标换行模式。 |
wrapModeU | 纹理 U 坐标换行模式。 |
wrapModeV | 纹理 V 坐标换行模式。 |
wrapModeW | Texture3D 的纹理 W 坐标换行模式。 |
ClearPlatformTextureSettings | 清除特定的目标平台设置。 |
DoesSourceTextureHaveAlpha | 纹理源图像是否具有 Alpha 通道。 |
GetAutomaticFormat | 返回将为此平台自动选择的 TextureImporterFormat。 |
GetDefaultPlatformTextureSettings | 获取特定于平台的默认纹理设置。 |
GetPlatformTextureSettings | 获取特定于平台的纹理设置。 |
ReadTextureImportInstructions | 读取此 TextureImporter 的活动纹理输出指令。 |
ReadTextureSettings | 将纹理设置读入 TextureImporterSettings 类。 |
SetPlatformTextureSettings | 设置特定的目标平台设置。 |
SetTextureSettings | 从 TextureImporterSettings 类中设置纹理导入器设置。 |
IsDefaultPlatformTextureFormatValid | Validates TextureImporterFormat based on the type of the current format (TextureImporterType) and the default platform. |
IsPlatformTextureFormatValid | Validates TextureImporterFormat based on a specified import type (TextureImporterType) and a specified build target (BuildTarget.). |
assetBundleName | 获取或设置 AssetBundle 名称。 |
assetBundleVariant | 获取或设置 AssetBundle 变体。 |
assetPath | 此导入器的资源的路径名称。(只读) |
importSettingsMissing | 如果导入的资源未随附任何元文件,则此值为 true。 |
userData | 获取或设置任意用户数据。 |
hideFlags | 该对象应该隐藏、随场景一起保存还是由用户修改? |
name | 对象的名称。 |
AddRemap | 将子资源从导入的资源(例如 FBX 文件)映射到同类型的外部资源。 |
GetExternalObjectMap | 获取 AssetImporter 使用的外部对象映射的副本。 |
RemoveRemap | 从外部对象的映射中删除项。 |
SaveAndReimport | 如果资源导入器已标记为“脏”,则保存资源导入器设置。 |
SetAssetBundleNameAndVariant | 设置 AssetBundle 名称和变体。 |
SupportsRemappedAssetType | 检查 AssetImporter 是否支持重新映射给定的资源类型。 |
GetInstanceID | 返回对象的实例 ID。 |
ToString | 返回对象的名称。 |
GetAtPath | 在 path 处检索资源的资源导入器。 |
Destroy | 移除 GameObject、组件或资源。 |
DestroyImmediate | 立即销毁对象 /obj/。强烈建议您改用 Destroy。 |
DontDestroyOnLoad | 在加载新的 Scene 时,请勿销毁 Object。 |
FindObjectOfType | 返回第一个类型为 type 的已加载的激活对象。 |
FindObjectsOfType | Gets a list of all loaded objects of Type type. |
Instantiate | 克隆 original 对象并返回克隆对象。 |
bool | 该对象是否存在? |
operator != | 比较两个对象是否引用不同的对象。 |
operator == | 比较两个对象引用,判断它们是否引用同一个对象。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.