@@ -145,18 +145,19 @@ protected override void DrawPropertyLayout(GUIContent label)
145145 GUI . enabled = true ;
146146 return ;
147147 }
148-
148+
149149 FieldInfo targetFieldInfo = FieldInfoHelper . GetFieldRecursively ( Attribute . Target . GetType ( ) , Attribute . Name ) ;
150150 FieldInfo parentFieldInfo = FieldInfoHelper . GetFieldRecursively ( Attribute . Parent . GetType ( ) , Attribute . Name ) ;
151-
151+
152152 if ( targetFieldInfo is null || parentFieldInfo is null )
153153 {
154154 this . CallNextDrawer ( label ) ;
155155 return ;
156156 }
157157
158-
159- GUILayout . BeginHorizontal ( ) ;
158+ // if (targetFieldInfo.FieldType.Name == "String" || targetFieldInfo.FieldType.IsPrimitive)
159+ if ( targetFieldInfo . FieldType . BaseType != typeof ( System . Object ) )
160+ GUILayout . BeginHorizontal ( ) ;
160161
161162 Rect rect = EditorGUILayout . GetControlRect ( ) ;
162163 Rect subRect = new Rect ( rect ) ;
@@ -177,21 +178,22 @@ protected override void DrawPropertyLayout(GUIContent label)
177178 Object unityObject = value as Object ;
178179 string parentFieldName =
179180 ( unityObject != null ) ? unityObject . name : ( value != null ? value . ToString ( ) : "None" ) ;
180-
181-
181+
182+
182183 Rect labelRect = new Rect ( rect . Split ( 1 , 2 ) ) ;
183-
184+
184185 GUIStyle labelStyle = new GUIStyle ( GUI . skin . label ) ;
185186 labelStyle . normal . textColor = new Color ( .5f , .5f , .5f ) ;
186187 labelStyle . alignment = TextAnchor . MiddleRight ;
187-
188+
188189 EditorGUI . LabelField ( labelRect , parentFieldName , labelStyle ) ;
189190 }
190191
191192 GUI . enabled = Attribute . IsOverriden ;
192193 this . CallNextDrawer ( noLabel ) ;
193194 GUI . enabled = true ;
194-
195- GUILayout . EndHorizontal ( ) ;
195+
196+ if ( targetFieldInfo . FieldType . BaseType != typeof ( System . Object ) )
197+ GUILayout . EndHorizontal ( ) ;
196198 }
197199}
0 commit comments