From 166f7c272822f6da1f5768f3e322104bd09cedd4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Perrier Date: Tue, 11 May 2021 16:09:27 +0200 Subject: [PATCH] Refactor. --- Source/Editor/CustomEditors/Editors/GenericEditor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/Editors/GenericEditor.cs b/Source/Editor/CustomEditors/Editors/GenericEditor.cs index fdbf75d1c..374684375 100644 --- a/Source/Editor/CustomEditors/Editors/GenericEditor.cs +++ b/Source/Editor/CustomEditors/Editors/GenericEditor.cs @@ -259,13 +259,14 @@ namespace FlaxEditor.CustomEditors.Editors { var p = properties[i]; var attributes = p.GetAttributes(true); + var showInEditor = attributes.Any(x => x is ShowInEditorAttribute); // Skip properties without getter or setter - if (!p.HasGet || (!p.HasSet && !attributes.Any(x => x is ShowInEditorAttribute))) + if (!p.HasGet || (!p.HasSet && !showInEditor)) continue; // Skip hidden fields, handle special attributes - if ((!p.IsPublic && !attributes.Any(x => x is ShowInEditorAttribute)) || attributes.Any(x => x is HideInEditorAttribute)) + if ((!p.IsPublic && !showInEditor) || showInEditor) continue; items.Add(new ItemInfo(p, attributes));