From 0a3a9920f3e1b068b2ec96f518fec288314c05f0 Mon Sep 17 00:00:00 2001 From: Lumos Date: Mon, 6 Jan 2020 12:45:50 +0100 Subject: [PATCH] Exclude strings from array types manually to prevent them from being treated as char arrays. --- Scripts/Editor/NodeEditorGUILayout.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Editor/NodeEditorGUILayout.cs b/Scripts/Editor/NodeEditorGUILayout.cs index 8383a81..0b8a0cd 100644 --- a/Scripts/Editor/NodeEditorGUILayout.cs +++ b/Scripts/Editor/NodeEditorGUILayout.cs @@ -340,7 +340,7 @@ namespace XNodeEditor { list.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { XNode.NodePort port = node.GetPort(fieldName + " " + index); - if (hasArrayData) { + if (hasArrayData && arrayData.propertyType != SerializedPropertyType.String) { if (arrayData.arraySize <= index) { EditorGUI.LabelField(rect, "Array[" + index + "] data out of range"); return; @@ -468,7 +468,7 @@ namespace XNodeEditor { EditorUtility.SetDirty(node); } - if (hasArrayData) { + if (hasArrayData && arrayData.propertyType != SerializedPropertyType.String) { if (arrayData.arraySize <= index) { Debug.LogWarning("Attempted to remove array index " + index + " where only " + arrayData.arraySize + " exist - Skipped"); Debug.Log(rl.list[0]);