Browse Source

VariableEditor PropertyDrawers copy label before GetPropertyHeight to ensure correct names are dispayed

master
desktop-maesty/steve 6 years ago
parent
commit
8a33c93391
  1. 6
      Assets/Fungus/Scripts/Editor/VariableEditor.cs

6
Assets/Fungus/Scripts/Editor/VariableEditor.cs

@ -209,13 +209,15 @@ namespace Fungus.EditorUtils
return; return;
} }
var origLabel = new GUIContent(label);
if (EditorGUI.GetPropertyHeight(valueProp, label) > EditorGUIUtility.singleLineHeight) if (EditorGUI.GetPropertyHeight(valueProp, label) > EditorGUIUtility.singleLineHeight)
{ {
DrawMultiLineProperty(position, label, referenceProp, valueProp, flowchart); DrawMultiLineProperty(position, origLabel, referenceProp, valueProp, flowchart);
} }
else else
{ {
DrawSingleLineProperty(position, label, referenceProp, valueProp, flowchart); DrawSingleLineProperty(position, origLabel, referenceProp, valueProp, flowchart);
} }
EditorGUI.EndProperty(); EditorGUI.EndProperty();

Loading…
Cancel
Save