File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
com.unity.netcode.gameobjects/Tests/Runtime Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -108,10 +108,17 @@ public override void OnDestroy()
108108 DeRegisterNetworkObject ( ) ;
109109 // This is required otherwise it will try to continue to update the NetworkBehaviour even if
110110 // it has been destroyed (most likely integration test specific)
111+ #if UNIFIED_NETCODE
112+ if ( m_NetworkObject . ChildNetworkBehaviours != null && m_NetworkObject . ChildNetworkBehaviours . ContainsKey ( NetworkBehaviourId ) )
113+ {
114+ NetworkObject . ChildNetworkBehaviours . Remove ( NetworkBehaviourId ) ;
115+ }
116+ #else
111117 if ( m_NetworkObject . ChildNetworkBehaviours != null && m_NetworkObject . ChildNetworkBehaviours . Contains ( this ) )
112118 {
113119 NetworkObject . ChildNetworkBehaviours . Remove ( this ) ;
114120 }
121+ #endif
115122 m_NetworkObject = null ;
116123 }
117124 base . OnDestroy ( ) ;
Original file line number Diff line number Diff line change 4747 "name": "Unity",
4848 "expression": "6000.1.0a1",
4949 "define": "HOSTNAME_RESOLUTION_AVAILABLE"
50+ },
51+ {
52+ "name": "com.unity.netcode",
53+ "expression": "1.10.1",
54+ "define": "UNIFIED_NETCODE"
5055 }
5156 ],
5257 "noEngineReferences": false
You can’t perform that action at this time.
0 commit comments