Skip to content

Conversation

fromanan
Copy link
Contributor

@fromanan fromanan commented Sep 25, 2025

Prior to Unity 2020, Object.FindObjectsOfType<T>(boolean) is not available and Object.FindObjectsOfType<T>() will return only active objects

For the preprocessor directives-- not all versions of Unity 2020 have the same ones defined for that version: https://discussions.unity.com/t/unity_2019_or_newer-not-recognised-in-unity-2020/815014

Making it safer to check for both, though it is admittedly a little ugly

Tested on Unity Versions 2018.4.36f1 (LTS), 2019.4.40f1 (LTS), and 2020.3.6f1 (LTS)

@RimuruDev RimuruDev merged commit cb8e5ad into RimuruDev:main Oct 3, 2025
@RimuruDev RimuruDev self-requested a review October 3, 2025 15:04
@RimuruDev RimuruDev added the enhancement New feature or request label Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants