浏览代码

Fix to LightmapScale tool

Corrected the LightmapScale script so that the editor-only .scaleInLightmap is used only in the editor.
/main
Ciro Continisio 3 年前
当前提交
942b0f59
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 6
      UOP1_Project/Assets/Scripts/EditorTools/LightmapScaleSetter.cs

6
UOP1_Project/Assets/Scripts/EditorTools/LightmapScaleSetter.cs


{
[SerializeField] private float _lightmapScale = 1f;
// Called when the Lightmap Scale field is changed in the component editor
private void OnValidate()
#if UNITY_EDITOR
// Called when the Lightmap Scale field is changed in the component editor
private void OnValidate()
{
// Clamp the lightmap scale to the range [0,1]
if (_lightmapScale < 0f)

meshRenderer.scaleInLightmap = _lightmapScale;
}
}
#endif
}
正在加载...
取消
保存