File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1010//
1111// **************************************************************** //
1212
13+ #if ! UNITY_2020_OR_NEWER && ! UNITY_2020_1_OR_NEWER
14+ using System . Linq ;
15+ #endif
16+
1317using UnityEditor ;
1418using UnityEngine ;
1519using UnityEditor . SceneManagement ;
@@ -42,8 +46,17 @@ private static GameObject[] FindGameObjects(bool includeInactive = true)
4246 : FindObjectsInactive . Exclude ;
4347
4448 return Object . FindObjectsByType < GameObject > ( inactiveMode , FindObjectsSortMode . InstanceID ) ;
45- #else
49+ #elif UNITY_2020_OR_NEWER || UNITY_2020_1_OR_NEWER
4650 return Object . FindObjectsOfType < GameObject > ( includeInactive ) ;
51+ #else
52+ if ( includeInactive )
53+ {
54+ return Resources . FindObjectsOfTypeAll < GameObject > ( ) . Cast < GameObject > ( ) . ToArray ( ) ;
55+ }
56+ else
57+ {
58+ return Object . FindObjectsOfType < GameObject > ( ) ;
59+ }
4760#endif
4861 }
4962
You can’t perform that action at this time.
0 commit comments