No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ShaderGraphUnlitGUI.cs 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using UnityEngine;
  3. using UnityEditor.Rendering.Universal;
  4. using static Unity.Rendering.Universal.ShaderUtils;
  5. namespace UnityEditor
  6. {
  7. // Used for ShaderGraph Unlit shaders
  8. class ShaderGraphUnlitGUI : BaseShaderGUI
  9. {
  10. MaterialProperty[] properties;
  11. // collect properties from the material properties
  12. public override void FindProperties(MaterialProperty[] properties)
  13. {
  14. // save off the list of all properties for shadergraph
  15. this.properties = properties;
  16. base.FindProperties(properties);
  17. }
  18. public static void UpdateMaterial(Material material, MaterialUpdateType updateType)
  19. {
  20. bool automaticRenderQueue = GetAutomaticQueueControlSetting(material);
  21. BaseShaderGUI.UpdateMaterialSurfaceOptions(material, automaticRenderQueue);
  22. BaseShaderGUI.UpdateMotionVectorKeywordsAndPass(material);
  23. }
  24. public override void ValidateMaterial(Material material)
  25. {
  26. UpdateMaterial(material, MaterialUpdateType.ModifiedMaterial);
  27. }
  28. // material main surface inputs
  29. public override void DrawSurfaceInputs(Material material)
  30. {
  31. DrawShaderGraphProperties(material, properties);
  32. }
  33. public override void DrawAdvancedOptions(Material material)
  34. {
  35. // Always show the queue control field. Only show the render queue field if queue control is set to user override
  36. DoPopup(Styles.queueControl, queueControlProp, Styles.queueControlNames);
  37. if (material.HasProperty(Property.QueueControl) && material.GetFloat(Property.QueueControl) == (float)QueueControl.UserOverride)
  38. materialEditor.RenderQueueField();
  39. base.DrawAdvancedOptions(material);
  40. materialEditor.DoubleSidedGIField();
  41. }
  42. }
  43. } // namespace UnityEditor