File tree Expand file tree Collapse file tree
com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1827,16 +1827,16 @@ protected void DestroySceneNetworkObjects()
18271827 // and then destroying the ghostAdapter prior to destroying
18281828 // a hybrid prefab.
18291829 var ghostAdapter = networkObject . GetComponent < GhostAdapter > ( ) ;
1830- if ( ghostAdapter != null && ghostAdapter . prefabReference != null )
1830+ if ( ghostAdapter != null )
18311831 {
1832- var prefabReference = ghostAdapter . prefabReference ;
1833- prefabReference . Prefab = null ;
1834- ghostAdapter . prefabReference = null ;
1835- Object . Destroy ( prefabReference ) ;
1836- Object . Destroy ( ghostAdapter ) ;
1837- // Only normally destroy hybrid-spawned objects.
1832+ if ( ghostAdapter . prefabReference != null )
1833+ {
1834+ var prefabReference = ghostAdapter . prefabReference ;
1835+ prefabReference . Prefab = null ;
1836+ ghostAdapter . prefabReference = null ;
1837+ Object . Destroy ( prefabReference ) ;
1838+ }
18381839 Object . Destroy ( networkObject . gameObject ) ;
1839- continue ;
18401840 }
18411841#endif
18421842 // Destroy the GameObject that holds the NetworkObject component
You can’t perform that action at this time.
0 commit comments