33
44namespace Toolbox . Editor . Hierarchy
55{
6+ /// <summary>
7+ /// Dedicates utility class used to draw horizontal/vertical lines when rendering tree connection lines within the Hierarchy window.
8+ /// </summary>
69 internal static class HierarchyTreeUtility
710 {
811 private const float dashLength = 4.0f ;
@@ -15,12 +18,12 @@ private static Rect GetLineRect(Rect rect, float thickness, float padding, bool
1518 : new Rect ( rect . x + padding / 2 , rect . y , thickness , rect . height ) ;
1619 }
1720
18- private static void DrawVerticalLine ( Rect rect , bool isDashed , float tickness , Color color )
21+ public static void DrawVerticalLine ( Rect rect , bool isDashed , float tickness , Color color )
1922 {
2023 DrawVerticalLine ( rect , isDashed , tickness , color , 0.0f ) ;
2124 }
2225
23- private static void DrawVerticalLine ( Rect rect , bool isDashed , float tickness , Color color , float paddingOffset )
26+ public static void DrawVerticalLine ( Rect rect , bool isDashed , float tickness , Color color , float paddingOffset )
2427 {
2528 rect = GetLineRect ( rect , tickness , rect . width - paddingOffset , false ) ;
2629 if ( ! isDashed )
@@ -44,12 +47,12 @@ private static void DrawVerticalLine(Rect rect, bool isDashed, float tickness, C
4447 }
4548 }
4649
47- private static void DrawHorizontalLine ( Rect rect , bool isDashed , float tickness , Color color )
50+ public static void DrawHorizontalLine ( Rect rect , bool isDashed , float tickness , Color color )
4851 {
4952 DrawHorizontalLine ( rect , isDashed , tickness , color , 0.0f ) ;
5053 }
5154
52- private static void DrawHorizontalLine ( Rect rect , bool isDashed , float tickness , Color color , float paddingOffset )
55+ public static void DrawHorizontalLine ( Rect rect , bool isDashed , float tickness , Color color , float paddingOffset )
5356 {
5457 rect = GetLineRect ( rect , tickness , rect . height - paddingOffset , true ) ;
5558 if ( ! isDashed )
@@ -73,11 +76,21 @@ private static void DrawHorizontalLine(Rect rect, bool isDashed, float tickness,
7376 }
7477 }
7578
79+ public static void DrawPassingLine ( Rect rect , bool isDashed , float tickness , Color color )
80+ {
81+ DrawPassingLine ( rect , isDashed , tickness , color , Vector2 . zero ) ;
82+ }
83+
7684 public static void DrawPassingLine ( Rect rect , bool isDashed , float tickness , Color color , Vector2 paddingOffset )
7785 {
7886 DrawVerticalLine ( rect , isDashed , tickness , color , paddingOffset . x ) ;
7987 }
8088
89+ public static void DrawCornerLine ( Rect rect , bool isDashed , float tickness , Color color )
90+ {
91+ DrawCornerLine ( rect , isDashed , tickness , color , Vector2 . zero , 0.0f ) ;
92+ }
93+
8194 public static void DrawCornerLine ( Rect rect , bool isDashed , float tickness , Color color , Vector2 paddingOffset , float horizontalSizeOffset )
8295 {
8396 //NOTE: -1 as a offset for halfs in corners
@@ -91,6 +104,11 @@ public static void DrawCornerLine(Rect rect, bool isDashed, float tickness, Colo
91104 DrawHorizontalLine ( horizontalRect , isDashed , tickness , color , paddingOffset . y ) ;
92105 }
93106
107+ public static void DrawCrossLine ( Rect rect , bool isDashed , float tickness , Color color )
108+ {
109+ DrawCrossLine ( rect , isDashed , tickness , color , Vector2 . zero , 0.0f ) ;
110+ }
111+
94112 public static void DrawCrossLine ( Rect rect , bool isDashed , float tickness , Color color , Vector2 paddingOffset , float horizontalSizeOffset )
95113 {
96114 DrawVerticalLine ( rect , isDashed , tickness , color , paddingOffset . x ) ;
0 commit comments