-
Notifications
You must be signed in to change notification settings - Fork 462
chore: update usage of deprecated FindObjectsByType<T>(FindObjectsSortMode) and enum FindObjectSortMode #3857
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
base: develop-2.0.0
Are you sure you want to change the base?
chore: update usage of deprecated FindObjectsByType<T>(FindObjectsSortMode) and enum FindObjectSortMode #3857
Conversation
EmandM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love love love this cleanup! ![]()
com.unity.netcode.gameobjects/Tests/Runtime/Prefabs/NetworkPrefabHandlerTests.cs
Outdated
Show resolved
Hide resolved
testproject/Assets/Tests/Manual/SceneTransitioningAdditive/NetworkManagerMonitor.cs
Outdated
Show resolved
Hide resolved
testproject/Assets/Tests/Manual/SceneTransitioningAdditive/NetworkManagerMonitor.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
| }, | ||
| { | ||
| "name": "Unity", | ||
| "expression": "[6000.4.0b5,6000.5.0a1)", | ||
| "define": "NGO_FINDOBJECTS_NOSORTING" | ||
| }, | ||
| { | ||
| "name": "Unity", | ||
| "expression": "6000.5.0a8", | ||
| "define": "NGO_FINDOBJECTS_NOSORTING" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you implemented this retro-compatibility fix to avoid compilation errors on alpha/beta versions that didn't have the deprecation change yet, but do we intend to support those versions in the long run?
The risk I foresee is that we fill our code with a bunch of defines for "almost-dead code", with an increased maintenance burden for us, and higher rissk to introduce bugs as we have to support multiple workflows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making it work with earlier versions actually prevents users that have yet to upgrade their editor from breaking if they decide to upgrade to the current version of NGO (whichever version that will be once this PR is merged). Otherwise, it would be considered a breaking change for earlier 6000.4 & 6000.5 versions.
But yeah... that is a good point and one of the reasons why I migrated all of the changes into the single FindObjects.ByType<T> method... so there is one place that handles this which also reduces the number of times we have to use the conditional define.
Test project had two places that I added this to in order to prevent from having to make FindObjects public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also do the work to remove the scripting defines once we no longer support that Unity version. So these defines won't live forever
EmandM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love love love the latest name here! ![]()
WIP-TODO:
Purpose of this PR
Making adjustments to the changes in FindObjectsByType. Funneling all find object related calls into a single static method in order to simplify the current, and any future, updates/changes to FindObjectsByType.
Jira ticket
MTT-14339
Changelog
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing doneUnityEngine.FindObjectsSortMode.UnityEngine.FindObjectsSortMode.UnityEngine.FindObjectsSortMode.UnityEngine.FindObjectsSortMode.Automated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Backports
No back port required since this is specific to 6000.4 & 6000.5.