From 78144464a7d7bf0274b038daf7aa5692bbbcd61a Mon Sep 17 00:00:00 2001 From: Tony Froman <33915703+fromanan@users.noreply.github.com> Date: Wed, 24 Sep 2025 22:38:57 -0400 Subject: [PATCH] Patch for earlier Unity versions --- Editor/MissingScriptsFinder.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Editor/MissingScriptsFinder.cs b/Editor/MissingScriptsFinder.cs index 3ea43b3..1a518ae 100644 --- a/Editor/MissingScriptsFinder.cs +++ b/Editor/MissingScriptsFinder.cs @@ -10,6 +10,10 @@ // // **************************************************************** // +#if !UNITY_2020_OR_NEWER && !UNITY_2020_1_OR_NEWER +using System.Linq; +#endif + using UnityEditor; using UnityEngine; using UnityEditor.SceneManagement; @@ -42,8 +46,17 @@ private static GameObject[] FindGameObjects(bool includeInactive = true) : FindObjectsInactive.Exclude; return Object.FindObjectsByType(inactiveMode, FindObjectsSortMode.InstanceID); -#else +#elif UNITY_2020_OR_NEWER || UNITY_2020_1_OR_NEWER return Object.FindObjectsOfType(includeInactive); +#else + if (includeInactive) + { + return Resources.FindObjectsOfTypeAll().Cast().ToArray(); + } + else + { + return Object.FindObjectsOfType(); + } #endif }