1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-21 01:36:03 +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)); Vector2 pos = rect.position + (port.IsOutput?new Vector2(rect.width + 6, 0) : new Vector2(-36, 0));
NodeEditorGUILayout.PortField(pos, port); NodeEditorGUILayout.PortField(pos, port);
}; };
list.elementHeightCallback = (int index) => { list.elementHeightCallback =
SerializedProperty itemData = arrayData.GetArrayElementAtIndex(index); (int index) => {
return EditorGUI.GetPropertyHeight(itemData); if (hasArrayData) {
}; SerializedProperty itemData = arrayData.GetArrayElementAtIndex(index);
return EditorGUI.GetPropertyHeight(itemData);
} else return EditorGUIUtility.singleLineHeight;
};
list.drawHeaderCallback = list.drawHeaderCallback =
(Rect rect) => { (Rect rect) => {
EditorGUI.LabelField(rect, label); EditorGUI.LabelField(rect, label);