Skip to content

Commit c8f54c9

Browse files
update
Adjusted to explicit handling of the update within test project script to avoid having to make FindObjects public.
1 parent 793bade commit c8f54c9

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

testproject/Assets/Tests/Manual/SceneTransitioningAdditive/NetworkManagerMonitor.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ public class NetworkManagerMonitor : MonoBehaviour
1010
// Start is called before the first frame update
1111
private void Start()
1212
{
13-
var networkManagerInstances = FindObjects.FindObjectsByType<NetworkManager>();
13+
#if UNITY_6000_4_OR_NEWER
14+
var networkManagerInstances = FindObjectsByType<NetworkManager>();
15+
#else
16+
#if UNITY_2023_1_OR_NEWER
17+
var networkManagerInstances = FindObjectsByType<NetworkManager>(FindObjectsSortMode.None);
18+
#else
19+
var networkManagerInstances = FindObjectsOfType<NetworkManager>();
20+
#endif
21+
#endif
22+
1423
foreach (var instance in networkManagerInstances)
1524
{
1625
if (instance.IsListening)

testproject/Assets/Tests/Manual/Scripts/NetworkPrefabPool.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,15 @@ private void ShowHideObjectIdLabelClientRpc(bool isVisible)
348348
{
349349
m_LabelEnabled = isVisible;
350350
NetworkObjectLabel.GlobalVisibility = m_LabelEnabled;
351-
var labels = FindObjects.FindObjectsByType<NetworkObjectLabel>();
351+
#if UNITY_6000_4_OR_NEWER
352+
var labels = FindObjectsByType<NetworkObjectLabel>();
353+
#else
354+
#if UNITY_2023_1_OR_NEWER
355+
var labels = FindObjectsByType<NetworkObjectLabel>(FindObjectsSortMode.None);
356+
#else
357+
var labels = FindObjectsOfType<NetworkObjectLabel>();
358+
#endif
359+
#endif
352360

353361
foreach (var label in labels)
354362
{

0 commit comments

Comments
 (0)