From 8a33c933915acc7f15938e969de50c3afb69bdb4 Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Sat, 28 Jul 2018 09:29:51 +1000 Subject: [PATCH] VariableEditor PropertyDrawers copy label before GetPropertyHeight to ensure correct names are dispayed --- Assets/Fungus/Scripts/Editor/VariableEditor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/Scripts/Editor/VariableEditor.cs b/Assets/Fungus/Scripts/Editor/VariableEditor.cs index 09a23582..3e8ee0ad 100644 --- a/Assets/Fungus/Scripts/Editor/VariableEditor.cs +++ b/Assets/Fungus/Scripts/Editor/VariableEditor.cs @@ -209,13 +209,15 @@ namespace Fungus.EditorUtils return; } + var origLabel = new GUIContent(label); + if (EditorGUI.GetPropertyHeight(valueProp, label) > EditorGUIUtility.singleLineHeight) { - DrawMultiLineProperty(position, label, referenceProp, valueProp, flowchart); + DrawMultiLineProperty(position, origLabel, referenceProp, valueProp, flowchart); } else { - DrawSingleLineProperty(position, label, referenceProp, valueProp, flowchart); + DrawSingleLineProperty(position, origLabel, referenceProp, valueProp, flowchart); } EditorGUI.EndProperty();