您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
20 行
499 B
20 行
499 B
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
public class DirectionalLightmapperCorrector : AssetPostprocessor
|
|
{
|
|
private void OnPostprocessTexture(Texture2D texture)
|
|
{
|
|
if (!(assetPath.Contains("Lightmap-") && assetPath.Contains("_comp_dir")))
|
|
return;
|
|
|
|
Color[] c = texture.GetPixels();
|
|
|
|
for (int i = 0; i < c.Length; i++)
|
|
{
|
|
c[i].a = Mathf.Max(c[i].a, 0.1f);
|
|
}
|
|
texture.SetPixels(c);
|
|
texture.Apply(true);
|
|
}
|
|
}
|