Skip to content

Commit edaf1fe

Browse files
committed
Put error back and fix timetravel
1 parent f1d94fd commit edaf1fe

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,9 +2632,7 @@ private List<NetworkBehaviour> BuildChildBehavioursList()
26322632
{
26332633
if (NetworkManagerOwner == null)
26342634
{
2635-
#if TEST_NO_SINGLETON
26362635
Debug.LogError("NetworkManagerOwner should be set! Setting owner to NetworkManager.Singleton");
2637-
#endif
26382636
NetworkManagerOwner = NetworkManager.Singleton;
26392637
}
26402638

com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,10 +2561,13 @@ public static void SimulateOneFrame()
25612561
var method = obj.GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
25622562
method?.Invoke(obj, new object[] { });
25632563

2564-
foreach (var behaviour in obj.ChildNetworkBehaviours)
2564+
if (obj.IsSpawned)
25652565
{
2566-
var behaviourMethod = behaviour.GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
2567-
behaviourMethod?.Invoke(behaviour, new object[] { });
2566+
foreach (var behaviour in obj.ChildNetworkBehaviours)
2567+
{
2568+
var behaviourMethod = behaviour.GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
2569+
behaviourMethod?.Invoke(behaviour, new object[] { });
2570+
}
25682571
}
25692572
}
25702573
}

0 commit comments

Comments
 (0)