From f57f57423c0aad97e639f7e46b50507242312183 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 13 Dec 2024 14:31:44 -0600 Subject: [PATCH] Fix Collection value containers to use correct value assignment. --- Source/Editor/CustomEditors/CustomEditor.cs | 2 +- Source/Editor/CustomEditors/Values/ValueContainer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/CustomEditor.cs b/Source/Editor/CustomEditors/CustomEditor.cs index 6b7bd4601..8c3810c3c 100644 --- a/Source/Editor/CustomEditors/CustomEditor.cs +++ b/Source/Editor/CustomEditors/CustomEditor.cs @@ -301,7 +301,7 @@ namespace FlaxEditor.CustomEditors _valueToSet = null; // Assign value - if (val is IList l && l.Count == _values.Count) + if (val is IList l && l.Count == _values.Count && _values.Count > 1) { for (int i = 0; i < _values.Count; i++) _values[i] = l[i]; diff --git a/Source/Editor/CustomEditors/Values/ValueContainer.cs b/Source/Editor/CustomEditors/Values/ValueContainer.cs index 601d20bb9..904d5bc09 100644 --- a/Source/Editor/CustomEditors/Values/ValueContainer.cs +++ b/Source/Editor/CustomEditors/Values/ValueContainer.cs @@ -386,7 +386,7 @@ namespace FlaxEditor.CustomEditors if (instanceValues.Count != Count) throw new ArgumentException(); - if (value is IList l && l.Count == Count) + if (value is IList l && l.Count == Count && Count > 1) { for (int i = 0; i < Count; i++) {