Sin descripción
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.

EditorUtils.cs 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using UnityEngine;
  2. using UnityEngine.Rendering.Universal;
  3. namespace UnityEditor.Rendering.Universal.Internal
  4. {
  5. /// <summary>
  6. /// Contains a database of built-in resource GUIds. These are used to load built-in resource files.
  7. /// </summary>
  8. public static class ResourceGuid
  9. {
  10. /// <summary>
  11. /// GUId for the <c>ScriptableRendererFeature</c> template file.
  12. /// </summary>
  13. public static readonly string rendererTemplate = "51493ed8d97d3c24b94c6cffe834630b";
  14. }
  15. }
  16. namespace UnityEditor.Rendering.Universal
  17. {
  18. static partial class EditorUtils
  19. {
  20. internal enum Unit { Metric, Percent }
  21. internal class Styles
  22. {
  23. //Measurements
  24. public static float defaultLineSpace = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
  25. public static readonly GUIContent alembicMotionVectors = EditorGUIUtility.TrTextContent("Alembic Motion Vectors",
  26. "When enabled, the material will use motion vectors from the Alembic animation cache. Should not be used on regular meshes or Alembic caches without precomputed motion vectors.");
  27. }
  28. internal static void FeatureHelpBox(string message, MessageType type)
  29. {
  30. CoreEditorUtils.DrawFixMeBox(message, type, "Open", () =>
  31. {
  32. EditorUtility.OpenPropertyEditor(UniversalRenderPipeline.asset.scriptableRendererData);
  33. GUIUtility.ExitGUI();
  34. });
  35. }
  36. internal static void QualitySettingsHelpBox(string message, MessageType type, string propertyPath)
  37. {
  38. CoreEditorUtils.DrawFixMeBox(message, type, "Open", () =>
  39. {
  40. var currentPipeline = UniversalRenderPipeline.asset;
  41. EditorUtility.OpenPropertyEditor(currentPipeline);
  42. CoreEditorUtils.Highlight(currentPipeline.name, propertyPath, HighlightSearchMode.Identifier);
  43. GUIUtility.ExitGUI();
  44. });
  45. }
  46. internal static void DrawRenderingLayerMask(SerializedProperty property, GUIContent style)
  47. {
  48. var renderingLayer = property.uintValue;
  49. EditorGUI.BeginChangeCheck();
  50. renderingLayer = EditorGUILayout.RenderingLayerMaskField(style, renderingLayer);
  51. if (EditorGUI.EndChangeCheck())
  52. property.uintValue = renderingLayer;
  53. }
  54. }
  55. }