Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Warning for Object.FindObjectOfType #42

Open
Grimeh opened this issue Dec 18, 2024 · 0 comments
Open

Compile Warning for Object.FindObjectOfType #42

Grimeh opened this issue Dec 18, 2024 · 0 comments

Comments

@Grimeh
Copy link

Grimeh commented Dec 18, 2024

Usage of Object.FindObjectOfType in GA_Menu.cs generates a compiler warning, since it has been marked obsolete in favour of the newer Object.FindAnyObjectByType, Object.FindFirstObjectByType, and Object.FindObjectsOfType methods.
While the newer methods have been backported to versions >=2020, the obsoletion warning currently only affects Unity 6 and Unity 2023.

In this case Object.FindAnyObjectByType (docs here) should be used instead for Unity versions >= 2020.3, 2021.3, 2022.2, 2023, 6000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant