Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IsPlatformTextureFormatValid(TextureImporterType, BuildTarget, TextureImporterFormat)

Validates TextureImporterFormat based on a specified import type ( TextureImporterType ) and a specified build target ( BuildTarget.).
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
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

boolReturns 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.