Skip to content

Commit 211a50f

Browse files
update
Updating runtimetests to the changes in ChildNetworkBehaviours.
1 parent 9546ff2 commit 211a50f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/Components/ObjectNameIdentifier.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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();

com.unity.netcode.gameobjects/Tests/Runtime/Unity.Netcode.Runtime.Tests.asmdef

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
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

0 commit comments

Comments
 (0)