Skip to content

Commit 402be86

Browse files
author
krzysztof biernat
committed
Chanage Variable property drawer look
1 parent 386ee4f commit 402be86

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Editor/Varaible/VariablePropertyDrawer.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ public class VariablePropertyDrawer : PropertyDrawer
2323

2424
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
2525
{
26-
return EditorGUI.GetPropertyHeight(property) + (valueProp != null ? EditorGUI.GetPropertyHeight(valueProp) : 0f);
26+
return EditorGUI.GetPropertyHeight(property);
2727
}
2828

2929
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
3030
{
3131
var propertyHeight = EditorGUI.GetPropertyHeight(property);
32-
var valuePosition = new Rect(position.x, position.y + propertyHeight, position.width, position.height - propertyHeight);
33-
position.height -= valuePosition.height;
32+
3433
EditorGUI.BeginChangeCheck();
35-
EditorGUI.PropertyField(position, property,label);
34+
position = EditorGUI.PrefixLabel(position,label);
35+
var valuePosition = new Rect(position.xMax - 60, position.y,60, position.height);
36+
position.width -= 65;
37+
EditorGUI.PropertyField(position, property,GUIContent.none);
3638
if (EditorGUI.EndChangeCheck())
3739
{
3840
if (property.objectReferenceValue != null)

0 commit comments

Comments
 (0)