- Home /
Question by
rasztemberg · Nov 28, 2014 at 08:37 PM ·
c#input
Unity, Property Drawers & GetPropertyHeight() not working
I have big problem with GetPropertyHeight().
I want to show my input fields the way they don't overlap in the inspector but so I also can type in the input fields. The problem is, when I fix the overlapping issue I CANT type values to the input fields any more :/
So that's when I either return small value from GetPropertyHeight() function or dont use the function at all.
When I return bigger values ( like 200) the fields dont overlap anymore but they become frozen.
Here is the simple code :
public override float GetPropertyHeight (SerializedProperty property,
GUIContent label) {
//return 16;
return 200;
}
public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
EditorGUIUtility.LookLikeControls();
showConfig = EditorGUI.Foldout (position, showConfig, label);
populationSize = property.FindPropertyRelative ("populationSize");
if (showConfig)
{
var pos_1 = new Rect (position.x, position.y + h * 1, position.width, h);
var pos_2 = new Rect (position.x, position.y + h * 2, position.width, h);
var pos_3 = new Rect (position.x, position.y + h * 3, position.width, h);
var pos_4 = new Rect (position.x, position.y + h * 4, position.width, h);
EditorGUI.indentLevel = 1;
EditorGUI.PropertyField (pos_1, property.FindPropertyRelative ("populationSize"));
EditorGUI.PropertyField (pos_2, property.FindPropertyRelative ("specieCount"));
EditorGUI.PropertyField (pos_3, property.FindPropertyRelative ("complexityThreshold"));
EditorGUI.PropertyField (pos_4, property.FindPropertyRelative ("complexityRegulationStrategy"));
}
}
Why is it or me so dumb ? Please Help :*
Comment
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Initialising List array for use in a custom Editor 1 Answer
Getting the text from UIInput 1 Answer