EditorUtility.CompressTexture 压缩纹理

static function CompressTexture (texture : Texture2D, format : TextureFormat) : void

Description描述

Compress a texture.

压缩纹理。

Use this function to explicitly compress a texture into specified format.

使用此函数显式压缩纹理到指定格式。

If you want to do texture compression in-game, use Texture2D.Compress function, which will use faster but lower quality DXT compression.

如果在游戏压缩纹理使用Texture2D.Compress函数,这将使用速度较快,但低质量的DXT压缩。

// Automatically Compress all imported textures to the project

// to RGB24

//自动压缩所有导入纹理到项目到RGB24



class MyTexturePostprocessor extends AssetPostprocessor {

	function OnPostprocessTexture (t : Texture2D) {

		EditorUtility.CompressTexture(t, TextureFormat.RGB24);

	}

}
Page last updated: 2011-7-15