Skip to content

Commit

Permalink
Fixed error on instanceportlists that aren't arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Siccity committed Oct 29, 2018
1 parent e9c6b6f commit ba69380
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Scripts/Editor/NodeEditorGUILayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,13 @@ private static ReorderableList CreateReorderableList(List<XNode.NodePort> instan
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);
Expand Down

0 comments on commit ba69380

Please sign in to comment.