http://blog.csdn.net/u010153703/article/details/39477887
“这篇文章里有两个明显的问题:
1. 处理Alpha贴图时是一个像素一个像素地处理,用Texture.SetPixel()函数。推荐批量处理,用Texture.SetPixels()函数。推荐批量处理,用Texture.SetPixels()函数。”
改进之:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using System.IO;
using System.Reflection;
public class MaterialTextureForETC1{
private static string defaultWhiteTexPath_relative = "Assets/Default_Alpha.png";
private static Texture2D defaultWhiteTex = null;
[MenuItem("EffortForETC1/Depart RGB and Alpha Channel")]
static void SeperateAllTexturesRGBandAlphaChannel()
{
Debug.Log("Start Departing.");
if (!GetDefaultWhiteTexture())
{
return;
}
string[] paths = Directory.GetFiles(Application.dataPath, "*.*", SearchOption.AllDirectories);
foreach (string path in paths)
{
if (!string.IsNullOrEmpty(path) && IsTextureFile(path) && !IsTextureConverted(path)) //full name
{
SeperateRGBAandlphaChannel(path);
}
}
AssetDatabase.Refresh(); //Refresh to ensure new generated RBA and Alpha textures shown in Unity as well as the meta file
Debug.Log("Finish Departing.");
}
#region proces

最低0.47元/天 解锁文章
16万+

被折叠的 条评论
为什么被折叠?



