Unity --- 如何简单的判断图片是否含有 alpha channel

1 var texImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;
2 if (texImporter.DoesSourceTextureHaveAlpha())
3 {
4     Debug.Log("textures source image don't have alpha channel ");
5 }
6 else
7 {
8     Debug.Log("textures source image have alpha channel ");
9 }
posted @ 2019-04-09 16:21  小·糊涂仙  阅读(1084)  评论(0编辑  收藏  举报