Skip to content

chore: update usage of deprecated FindObjectsByType<T>(FindObjectsSortMode) and enum FindObjectSortMode#3857

Merged
NoelStephensUnity merged 22 commits intodevelop-2.0.0from
chore/findobjectsbytype-no-more-sorting-update
Feb 4, 2026
Merged

chore: update usage of deprecated FindObjectsByType<T>(FindObjectsSortMode) and enum FindObjectSortMode#3857
NoelStephensUnity merged 22 commits intodevelop-2.0.0from
chore/findobjectsbytype-no-more-sorting-update

Conversation

@NoelStephensUnity
Copy link
Member

@NoelStephensUnity NoelStephensUnity commented Jan 26, 2026

Purpose of this PR

Making adjustments to the changes in FindObjectsByType that no longer supports FindObjectSortMode. 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

  • Changed: Updating usage of deprecated FindObjectsByType(FindObjectsSortMode) and enum FindObjectSortMode in 6000.4 and 6000.5.

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done
    • Verify earlier versions of 6000.4 and 6000.5 work as expected
      • Open test project in 6000.4.b5 or earlier to verify NGO uses the (now deprecated) UnityEngine.FindObjectsSortMode.
      • Open test project in 6000.5.a6 or earlier to verify NGO uses the (now deprecated) UnityEngine.FindObjectsSortMode.
    • Verify newer versions of 6000.4 and 6000.5 work as expected
      • Open test project in 6000.4.b6 or later to verify NGO no longer uses UnityEngine.FindObjectsSortMode.
      • Open test project in 6000.5.a7 or later to verify NGO no longer uses UnityEngine.FindObjectsSortMode.

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does 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.

Funneling all find object related calls into a single static method in order to simplify the current, and any future, updates/changes to FindObjectsByType.
@NoelStephensUnity NoelStephensUnity requested review from a team and EmandM as code owners January 26, 2026 20:45
Making FindObjects internal.
Adjusted to explicit handling of the update within test project script to avoid having to make FindObjects public.
Adding [MethodImpl(MethodImplOptions.AggressiveInlining)] attribute to the T[] FindObjectsByType<T>() method.
Removing unused using directives.
Removing CR.
Copy link
Member

@EmandM EmandM left a 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! :godmode:

NoelStephensUnity and others added 2 commits January 26, 2026 16:07
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Adding same condition define, NGO_FINDOBJECTS_NOSORTING, to the testproject.manualtests assembly define.
Added more precise Unity engine versions to asmdef files to assure earlier versions of 6000.4 and 6000.5 still use the previous API.
Renamed FindObjects.FindObjectsByType to FindObjects.ByType
Updated FindObject.ByType to be able to sort by identifier and include inactive objects.
Adding sort by identifier to two locations that require sorting by identifier.
Added missing whitespace
increasing the 6000.5 version from 5.0a6 to 5.0a7 as it appears trunk is currently 5.0a6 (which doesn't have the deprecation merged into it yet).
updating minimum for deprecated fix to 6000.5.0a8.
Copy link
Member

@EmandM EmandM left a 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! :godmode:

@michalChrobot
Copy link
Member

@NoelStephensUnity the trunk PR landed so we can try to run CI for 6000.4 and trunk to double check if it works now

Re-targeting 6000.5.0a7 as the version of unity with the FindObjectsByType changes.
@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) February 4, 2026 18:33
Moving changelog entry into the unreleased section.
@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) February 4, 2026 19:55
@NoelStephensUnity NoelStephensUnity merged commit 834bcdf into develop-2.0.0 Feb 4, 2026
25 checks passed
@NoelStephensUnity NoelStephensUnity deleted the chore/findobjectsbytype-no-more-sorting-update branch February 4, 2026 21:04
michalChrobot pushed a commit that referenced this pull request Feb 5, 2026
…tMode) and enum FindObjectSortMode (#3857)

* update

Funneling all find object related calls into a single static method in order to simplify the current, and any future, updates/changes to FindObjectsByType.

* update

Making FindObjects internal.

* update

Adjusted to explicit handling of the update within test project script to avoid having to make FindObjects public.

* update

Adding [MethodImpl(MethodImplOptions.AggressiveInlining)] attribute to the T[] FindObjectsByType<T>() method.

* style

Removing unused using directives.
Removing CR.

* Update com.unity.netcode.gameobjects/Runtime/Core/FindObjects.cs

Co-authored-by: Emma <emma.mcmillan@unity3d.com>

* update

Adding same condition define, NGO_FINDOBJECTS_NOSORTING, to the testproject.manualtests assembly define.

* update

Added more precise Unity engine versions to asmdef files to assure earlier versions of 6000.4 and 6000.5 still use the previous API.
Renamed FindObjects.FindObjectsByType to FindObjects.ByType
Updated FindObject.ByType to be able to sort by identifier and include inactive objects.

* update

Adding sort by identifier to two locations that require sorting by identifier.

* style

Added missing whitespace

* update

increasing the 6000.5 version from 5.0a6 to 5.0a7 as it appears trunk is currently 5.0a6 (which doesn't have the deprecation merged into it yet).

* update

updating minimum for deprecated fix to 6000.5.0a8.

* update

This "should" fix the Rust server issue... I think?
(Tested local instance on 6000.5.0a7 and it passes everything)

* update

adding change log entry

* update

Re-targeting 6000.5.0a7 as the version of unity with the FindObjectsByType changes.

* update

Moving changelog entry into the unreleased section.

---------

Co-authored-by: Emma <emma.mcmillan@unity3d.com>
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

Successfully merging this pull request may close these issues.

5 participants