浏览代码

Fix issue with LOD0 using lightprobes

instead of assuming there is always a lightmap, just copy the lightprobe usage from LOD0.
/main
GitHub 6 年前
当前提交
3b68407f
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 7
      Assets/Demo/Scripts/utilities/LightmappedLOD.cs

7
Assets/Demo/Scripts/utilities/LightmappedLOD.cs


[ExecuteInEditMode]
public class LightmappedLOD : MonoBehaviour {
//public int LODIndex = 1;
// Use this for initialization
private void Awake()
{
currentRenderer = gameObject.GetComponent<MeshRenderer>();

{
try
{
renderers[i].lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off;
renderers[i].lightProbeUsage = lods[0].renderers[i].lightProbeUsage;
renderers[i].lightmapIndex = lods[0].renderers[i].lightmapIndex;
renderers[i].lightmapScaleOffset = lods[0].renderers[i].lightmapScaleOffset;

}
}
}
}
}
正在加载...
取消
保存