Files
beyond/Assets/ThirdParty/Lux URP Essentials/Scripts/Editor/LuxURPCustomWaterShaderGUI.__cs
2024-11-20 15:21:28 +01:00

27 lines
901 B
Plaintext

using UnityEngine;
using UnityEditor;
public class LuxURPCustomWaterShaderGUI : ShaderGUI
{
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
base.OnGUI(materialEditor, properties);
Material material = materialEditor.target as Material;
MaterialProperty _EnableRefraction = ShaderGUI.FindProperty("_EnableRefraction", properties);
if (_EnableRefraction.floatValue == 1.0f) {
material.SetFloat("_DstBlend", 0.0f);
}
else {
material.SetFloat("_DstBlend", 10.0f);
}
// Needed to make the Selection Outline work
if (material.HasProperty("_MainTex") && material.HasProperty("_BaseMap") ) {
if (material.GetTexture("_BaseMap") != null) {
material.SetTexture("_MainTex", material.GetTexture("_BaseMap"));
}
}
}
}