暫無描述
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.

BakedLitGUI.cs 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Rendering;
  4. namespace UnityEditor.Rendering.Universal.ShaderGUI
  5. {
  6. /// <summary>
  7. /// Editor script for the BakedLit material inspector.
  8. /// </summary>
  9. public static class BakedLitGUI
  10. {
  11. /// <summary>
  12. /// Container for the properties used in the <c>BakedLitGUI</c> editor script.
  13. /// </summary>
  14. public struct BakedLitProperties
  15. {
  16. // Surface Input Props
  17. /// <summary>
  18. /// The MaterialProperty for normal map.
  19. /// </summary>
  20. public MaterialProperty bumpMapProp;
  21. /// <summary>
  22. /// Constructor for the <c>BakedLitProperties</c> container struct.
  23. /// </summary>
  24. /// <param name="properties"></param>
  25. public BakedLitProperties(MaterialProperty[] properties)
  26. {
  27. // Surface Input Props
  28. bumpMapProp = BaseShaderGUI.FindProperty("_BumpMap", properties, false);
  29. }
  30. }
  31. /// <summary>
  32. /// Draws the surface inputs GUI.
  33. /// </summary>
  34. /// <param name="properties"></param>
  35. /// <param name="materialEditor"></param>
  36. public static void Inputs(BakedLitProperties properties, MaterialEditor materialEditor)
  37. {
  38. BaseShaderGUI.DrawNormalArea(materialEditor, properties.bumpMapProp);
  39. }
  40. }
  41. }