EditModeGUIUtils.cs 739 B

123456789101112131415161718192021222324252627
  1. using UnityEngine;
  2. namespace UnityEditor.Timeline
  3. {
  4. static class EditModeGUIUtils
  5. {
  6. public static void DrawBoundsEdge(Rect bounds, Color color, TrimEdge edge, float width = 4.0f)
  7. {
  8. var r = bounds;
  9. r.yMin += 2.0f;
  10. r.yMax -= 2.0f;
  11. r.width = width;
  12. r.x = edge == TrimEdge.End ? bounds.xMax : bounds.xMin - width;
  13. EditorGUI.DrawRect(r, color);
  14. }
  15. public static void DrawOverlayRect(Rect bounds, Color overlayColor)
  16. {
  17. var c = overlayColor;
  18. c.a = 0.2f;
  19. EditorGUI.DrawRect(bounds, c);
  20. EditorGUI.DrawOutline(bounds, 1.0f, new Color(1.0f, 1.0f, 1.0f, 0.5f));
  21. }
  22. }
  23. }