Hope somebody can help with this weird problem,
I am drawing a popup menu in the editor from a custom property drawer, on PC the popup draws exactly as expected, however on a mac the popup is drawn right at the top of the window as shown in the image.
the code:
[CustomPropertyDrawer(typeof(SoundSelector))]
public class SoundSelectorDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
SoundSelector soundSelectorAttribute = attribute as SoundSelector;
Rect labelPos = new Rect (position.x, position.y, position.width * 0.4f, position.height);
Rect popupPos = new Rect (position.x + position.width * 0.4f, position.y, position.width * 0.6f, position.height);
var index = soundSelectorAttribute.names.FindIndex(s => s == property.stringValue);
EditorGUI.LabelField(labelPos, property.displayName);
index = EditorGUI.Popup(popupPos, index, soundSelectorAttribute.keys.ToArray());
if (index >= 0) {
property.stringValue = soundSelectorAttribute.names[index];
}
else {
//default value
property.stringValue = soundSelectorAttribute.names[0];
}
}
}
does anyone know what the cause of this could be?
Much appreciated!