File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
com.unity.netcode.gameobjects
Tests/Runtime/TestHelpers Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments