textureSubtargetFormat | The Subformat of the texture for the WebGL platform. |
TextureFormat The texture should be convert into the target fomrat.
Get the specific image format that the corresponding image of type global should be converted into.
using UnityEditor; using System.IO; using UnityEngine;
public class DisplayInfo { [MenuItem("TextureFormat/GetTextureFormatforASTC")] static void GetTextureFormat() { TextureImporter textureImporter = AssetImporter.GetAtPath("path/to/texture") as TextureImporter; var textureFormat = textureImporter.GetPlatformTextureFormat(WebGLTextureSubtarget.ASTC); UnityEngine.Debug.Log($"Get Texture Format {textureFormat} with WebGLTextureSubtarget.ASTC"); } }