您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
22 行
555 B
22 行
555 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
public class DirectionalLightmapperCorrector : AssetPostprocessor
|
|
{
|
|
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);
|
|
}
|
|
}
|