Hi,
Looking for some reference for writing custom ShaderGUI’s for shaders made in shader graph like combining properties in dropdown menus etc. in inspector view
This:
isn`t very helpfull and im having issues to find working samples, nothing i’ve tried worked…
This is my latest attempt:
public class ShaderGUI_Skybox : ShaderGUI
{
override public void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
bool showstuff = false;
base.OnGUI(materialEditor, properties);
EditorGUI.BeginChangeCheck();
if (GUILayout.Button("Select GUI Color"))
{
showstuff = !showstuff;
Debug.Log(showstuff);
}
if (EditorGUI.EndChangeCheck())
{
Debug.Log("End");
if (showstuff)
{
// Sun
EditorGUILayout.LabelField("Sun", EditorStyles.boldLabel);
string[] SunReferences = { "_SunScale", "_SunConvergence", "_SunIntensity" };
foreach (string Reference in SunReferences)
{
MaterialProperty SunReference = ShaderGUI.FindProperty(Reference, properties);
materialEditor.ShaderProperty(SunReference, SunReference.displayName);
}
}
}
Debug.Log works but the GUI in inspector does nuthing and im totally lost :)…