1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 09:16:01 +08:00

Fixed error on instanceportlists that aren't arrays

This commit is contained in:
Thor Brigsted 2018-10-29 21:20:22 +01:00
parent e9c6b6f221
commit ba69380638

View File

@ -285,10 +285,13 @@ namespace XNodeEditor {
Vector2 pos = rect.position + (port.IsOutput?new Vector2(rect.width + 6, 0) : new Vector2(-36, 0));
NodeEditorGUILayout.PortField(pos, port);
};
list.elementHeightCallback = (int index) => {
SerializedProperty itemData = arrayData.GetArrayElementAtIndex(index);
return EditorGUI.GetPropertyHeight(itemData);
};
list.elementHeightCallback =
(int index) => {
if (hasArrayData) {
SerializedProperty itemData = arrayData.GetArrayElementAtIndex(index);
return EditorGUI.GetPropertyHeight(itemData);
} else return EditorGUIUtility.singleLineHeight;
};
list.drawHeaderCallback =
(Rect rect) => {
EditorGUI.LabelField(rect, label);