IsPlatformTextureFormatValid(TextureImporterType, BuildTarget, TextureImporterFormat)
Validates TextureImporterFormat based on a specified import type ( TextureImporterType ) and a specified build target ( BuildTarget.).
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor
public static bool IsPlatformTextureFormatValid(TextureImporterType textureType, BuildTarget target, TextureImporterFormat currentFormat)
Parameters
The TextureImporterType that the importer uses.
The platform that the setting targets, referred to as the BuilTarget.
The TextureImporterFormat to validate.
Returns
Type | Description |
|---|---|
| bool | Returns true if TextureImporterFormat is valid and can be set. Returns false otherwise. |
Remarks
TextureImporterFormat is not available for all platforms based on the TextureImporterType of a given Texture. Use this method to check that the format set with TextureImporter.SetPlatformTextureSettings is a valid format.