66
77namespace TNRD . Drawers
88{
9- internal class RawReferenceDrawer : ReferenceDrawer , IReferenceDrawer
9+ internal partial class RawReferenceDrawer : ReferenceDrawer , IReferenceDrawer
1010 {
1111 private GUIContent label ;
1212 private FieldInfo fieldInfo ;
@@ -26,9 +26,7 @@ public float GetHeight()
2626 if ( RawReferenceValue == null )
2727 return EditorGUIUtility . singleLineHeight ;
2828
29- return EditorGUIUtility . singleLineHeight +
30- EditorGUIUtility . standardVerticalSpacing +
31- EditorGUI . GetPropertyHeight ( RawReferenceProperty , true ) ;
29+ return EditorGUI . GetPropertyHeight ( RawReferenceProperty , true ) ;
3230 }
3331
3432 /// <inheritdoc />
@@ -53,16 +51,32 @@ public void OnGUI(Rect position)
5351
5452 if ( rawReferenceValue == null )
5553 return ;
54+
55+ DrawLine ( position ) ;
56+ DrawProperty ( position ) ;
57+
58+ previousPropertyPath = Property . propertyPath ;
59+ }
5660
61+ private void DrawProperty ( Rect position )
62+ {
5763 Rect objectDrawerRect = new Rect ( position ) ;
58- objectDrawerRect . yMin += EditorGUIUtility . singleLineHeight + EditorGUIUtility . standardVerticalSpacing ;
59-
64+
6065 EditorGUI . PropertyField ( objectDrawerRect ,
6166 RawReferenceProperty ,
62- new GUIContent ( rawReferenceValue . GetType ( ) . Name ) ,
67+ GUIContent . none ,
6368 true ) ;
69+ }
6470
65- previousPropertyPath = Property . propertyPath ;
71+ private void DrawLine ( Rect position )
72+ {
73+ Rect line = new Rect ( position )
74+ {
75+ width = 4 ,
76+ yMin = position . yMin + EditorGUIUtility . singleLineHeight ,
77+ x = position . x + 2f
78+ } ;
79+ EditorGUI . DrawRect ( line , Styles . LineColor ) ;
6680 }
6781
6882 protected override void PingObject ( )
0 commit comments