Skip to content

Commit 292d1d2

Browse files
committed
Fix merge
1 parent b5d5dbb commit 292d1d2

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,20 +1711,15 @@ internal void SetIsDestroying()
17111711
return;
17121712
}
17131713

1714-
if (m_ChildNetworkBehaviours != null)
1714+
if (ChildNetworkBehaviours != null)
17151715
{
1716-
foreach (var childBehaviour in m_ChildNetworkBehaviours)
1716+
foreach (var childBehaviour in ChildNetworkBehaviours.Values)
17171717
{
1718-
// Just ignore and continue processing through the entries
1719-
if (!childBehaviour)
1720-
{
1721-
continue;
1722-
}
1723-
1718+
// Tell the childBehaviour that this NetworkObject is being destroyed.
17241719
// Keeping the property a private set to assure this is
17251720
// the only way it can be set as it should never be reset
17261721
// back to false once invoked.
1727-
childBehaviour.SetIsDestroying();
1722+
childBehaviour?.SetIsDestroying();
17281723
}
17291724
}
17301725
IsDestroying = true;

0 commit comments

Comments
 (0)