Skip to content

Commit 6f2f944

Browse files
committed
small fixes
1 parent 5bba965 commit 6f2f944

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,6 +2172,10 @@ internal void InvokeSessionOwnerPromoted(bool isSessionOwner)
21722172

21732173
internal void InvokeBehaviourOnNetworkObjectParentChanged(NetworkObject parentNetworkObject)
21742174
{
2175+
if (ChildNetworkBehaviours == null)
2176+
{
2177+
InitializeChildNetworkBehaviours();
2178+
}
21752179
foreach (var child in ChildNetworkBehaviours.Values)
21762180
{
21772181
// Any NetworkBehaviour that is not spawned and the associated GameObject is disabled should be
@@ -2711,6 +2715,10 @@ internal void InternalInSceneNetworkObjectsSpawned()
27112715

27122716
internal void InvokeBehaviourNetworkDespawn()
27132717
{
2718+
if (ChildNetworkBehaviours == null)
2719+
{
2720+
InitializeChildNetworkBehaviours();
2721+
}
27142722
// Invoke OnNetworkPreDespawn on all child behaviours
27152723
foreach (var childBehaviour in ChildNetworkBehaviours.Values)
27162724
{

0 commit comments

Comments
 (0)