From 950b507f008c12df881add64117500a1b6199ab9 Mon Sep 17 00:00:00 2001 From: StCost Date: Thu, 25 Jan 2024 03:02:21 +0200 Subject: [PATCH] Fix CS0618: [PreferenceItem] is obsolete (AutoLOD.cs) --- Editor/AutoLOD.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Editor/AutoLOD.cs b/Editor/AutoLOD.cs index a440a72..115015d 100644 --- a/Editor/AutoLOD.cs +++ b/Editor/AutoLOD.cs @@ -683,8 +683,19 @@ static void RemoveLODs(GameObject go) } } +#if UNITY_2018_3_OR_NEWER + [SettingsProvider] + static SettingsProvider PreferencesGUI() + { + return new SettingsProvider("Preferences/AutoLOD", SettingsScope.User) + { + guiHandler = (searchContext) => DeprecatedPreferencesGUI(), + }; + } +#else [PreferenceItem("AutoLOD")] - static void PreferencesGUI() +#endif + static void DeprecatedPreferencesGUI() { EditorGUILayout.BeginVertical(); EditorGUILayout.Space();