File tree Expand file tree Collapse file tree
com.unity.netcode.gameobjects/Runtime/Core Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments