diff --git a/Editor/AbstractPropertyDrawer.cs b/Editor/AbstractPropertyDrawer.cs index 37f0a48..1879be4 100644 --- a/Editor/AbstractPropertyDrawer.cs +++ b/Editor/AbstractPropertyDrawer.cs @@ -24,7 +24,6 @@ namespace Module.Inspector.Editor bool prevEnabled = GUI.enabled; GUI.enabled = accessType == EAccessType.Enabled; - // TODO: What to do with [Obsolete]? if (result.draw != null) { diff --git a/Editor/Utilities/EditorPropertyUtility.cs b/Editor/Utilities/EditorPropertyUtility.cs index 38c0cef..b830539 100644 --- a/Editor/Utilities/EditorPropertyUtility.cs +++ b/Editor/Utilities/EditorPropertyUtility.cs @@ -126,14 +126,24 @@ namespace Module.Inspector.Editor.Utilities } } - if (!string.IsNullOrEmpty(obsoleteText)) + if (isObsolete) { - if (tooltip != null) - tooltip += $"\n[Obsolete: {obsoleteText}"; + if (string.IsNullOrEmpty(obsoleteText)) + { + if (tooltip != null) + tooltip += $"\n[Obsolete]"; + else + tooltip = $"[Obsolete]"; + } else - tooltip = $"Obsolete: {obsoleteText}"; + { + if (tooltip != null) + tooltip += $"\n[Obsolete: {obsoleteText}]"; + else + tooltip = $"[Obsolete: {obsoleteText}]"; + } } - + return new Result(drawer, predrawerModifiers, valueModifiers, accessModifiers, tooltip, isObsolete); }