EditorGUI.GetPropertyHeight does some unwanted side effects?
I wrote this useless drawer that is supposed to do nothing
[CustomPropertyDrawer(typeof(DoesNothingAttribute))]
public class DoesNothingDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
// float propHeight = EditorGUI.GetPropertyHeight(property, label);
EditorGUI.PropertyField(position, property, label);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
float height = EditorGUI.GetPropertyHeight(property, label);
return height;
}
}
This works as it was meant - does nothing, just draws the property
If I uncomment the line float propHeight = EditorGUI.GetPropertyHeight(property, label);
which must not affect any other stuff because it's just a getter I get
What is going on? Is it my fault or unity's one?
2020.3.14f1
UPD
Me and my mate figured out that this doesn't apply to 2019.4.18f1
The same code behaves differently on these two versions
Someone from unity team had broken the GUI code
Your answer
Follow this Question
Related Questions
How to create a selection menu in the inspector for classes and their methods? 1 Answer
Unity Editor big laagspikes 0 Answers
SerializedProperty for Array not declared as an array (isArray = false) 0 Answers
Editor Int sliders affecting each other 0 Answers
how would I display an array correctly with from an editor script? 0 Answers