using System; using UnityEngine; using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.Rendering.HighDefinition { class WaterDecalShaderGraphGUI : HDShaderGUI { [Flags] enum ExpandableBit : uint { SurfaceOptions = 1 << 0, SurfaceInputs = 1 << 1, } MaterialUIBlockList m_UIBlocks = new MaterialUIBlockList { new WaterDecalSurfaceOptionsUIBlock((MaterialUIBlock.ExpandableBit)ExpandableBit.SurfaceOptions), new ShaderGraphUIBlock((MaterialUIBlock.ExpandableBit)ExpandableBit.SurfaceInputs, ShaderGraphUIBlock.Features.ExposedProperties), }; /// The list of UI Blocks Unity uses to render the material inspector. protected MaterialUIBlockList uiBlocks => m_UIBlocks; /// /// Override this function to implement your custom GUI. To display a user interface similar to HDRP shaders, use a MaterialUIBlockList. /// /// The current material editor. /// The list of properties the material has. protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] props) { uiBlocks.OnGUI(materialEditor, props); } /// /// Sets up the keywords and passes for a Decal Shader Graph material. /// /// The selected material. public static void SetupDecalKeywordsAndPass(Material material) => WaterDecalAPI.SetupWaterDecalKeywordsAndProperties(material); /// /// Sets up the keywords and passes for the current selected material. /// /// The selected material. public override void ValidateMaterial(Material material) => ShaderGraphAPI.ValidateWaterDecalMaterial(material); } }