From f3111e855df3b016f36edff63dc3a19dda3167aa Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 3 Feb 2026 19:48:57 +0100 Subject: [PATCH] Fix showing C++ structures inlined in collection editor when they have a single property/field --- Source/Editor/CustomEditors/Editors/CollectionEditor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs index 28593a7f5..02742b512 100644 --- a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs +++ b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs @@ -593,11 +593,12 @@ namespace FlaxEditor.CustomEditors.Editors panel.Panel.Offsets = new Margin(7, 7, 0, 0); panel.Panel.BackgroundColor = _background; var elementType = ElementType; + var bindingAttr = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public; bool single = elementType.IsPrimitive || elementType.Equals(new ScriptType(typeof(string))) || elementType.IsEnum || - (elementType.GetFields().Length == 1 && elementType.GetProperties().Length == 0) || - (elementType.GetProperties().Length == 1 && elementType.GetFields().Length == 0) || + (elementType.GetFields(bindingAttr).Length == 1 && elementType.GetProperties(bindingAttr).Length == 0) || + (elementType.GetProperties(bindingAttr).Length == 1 && elementType.GetFields(bindingAttr).Length == 0) || elementType.Equals(new ScriptType(typeof(JsonAsset))) || elementType.Equals(new ScriptType(typeof(SettingsBase))); if (_cachedDropPanels == null)