压缩立方体贴图纹理。
使用此函数将立方体贴图显式压缩为指定格式。
using UnityEngine; using UnityEditor;
public class CompressCubemapTextureExample : AssetPostprocessor { // Automatically Compress all imported cube map textures to the project to RGB24 void OnPostprocessTexture(Cubemap t) { EditorUtility.CompressCubemapTexture(t, TextureFormat.RGB24, TextureCompressionQuality.Normal); } }