SGEUnlitShader.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // ShaderGraphEssentials for Unity
  3. // (c) 2019 PH Graphics
  4. // Source code may be used and modified for personal or commercial projects.
  5. // Source code may NOT be redistributed or sold.
  6. //
  7. // *** A NOTE ABOUT PIRACY ***
  8. //
  9. // If you got this asset from a pirate site, please consider buying it from the Unity asset store. This asset is only legally available from the Unity Asset Store.
  10. //
  11. // I'm a single indie dev supporting my family by spending hundreds and thousands of hours on this and other assets. It's very offensive, rude and just plain evil to steal when I (and many others) put so much hard work into the software.
  12. //
  13. // Thank you.
  14. //
  15. // *** END NOTE ABOUT PIRACY ***
  16. //
  17. using UnityEngine;
  18. using UnityEditor;
  19. using System;
  20. namespace ShaderGraphEssentials
  21. {
  22. public class SGEUnlitShader : ShaderGUI
  23. {
  24. public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
  25. {
  26. // render the default gui
  27. //base.OnGUI(materialEditor, properties);
  28. var cullingProp = FindProperty("_MyValue", properties);
  29. GUIContent queueSlider = new GUIContent("My Custom Value",
  30. "Determines the chronological rendering order for a Material. High values are rendered first.");
  31. EditorGUI.BeginChangeCheck();
  32. int culling = EditorGUILayout.IntSlider(queueSlider, (int) cullingProp.floatValue, 0, 2);
  33. if (EditorGUI.EndChangeCheck())
  34. cullingProp.floatValue = culling;
  35. }
  36. }
  37. }