Skip to content

Commit b430664

Browse files
update
Adding a warning generation method to make testing easier.
1 parent e43d65e commit b430664

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2619,6 +2619,11 @@ internal void InvokeBehaviourNetworkDespawn()
26192619

26202620
private List<NetworkBehaviour> m_ChildNetworkBehaviours;
26212621

2622+
internal string GenerateDisabledNetworkBehaviourWarning(NetworkBehaviour networkBehaviour)
2623+
{
2624+
return $"[{name}][{networkBehaviour.GetType().Name}][{nameof(isActiveAndEnabled)}: {networkBehaviour.isActiveAndEnabled}] Disabled {nameof(NetworkBehaviour)}s are not supported and will be excluded from spawning and synchronization!";
2625+
}
2626+
26222627
internal List<NetworkBehaviour> ChildNetworkBehaviours
26232628
{
26242629
get
@@ -2641,7 +2646,7 @@ internal List<NetworkBehaviour> ChildNetworkBehaviours
26412646
}
26422647
else if (!networkBehaviours[i].isActiveAndEnabled)
26432648
{
2644-
Debug.LogWarning($"[{name}][{networkBehaviours[i].GetType().Name}][{nameof(isActiveAndEnabled)}: {networkBehaviours[i].isActiveAndEnabled}] Disabled {nameof(NetworkBehaviour)}s are not supported and will be excluded from spawning and synchronization!");
2649+
Debug.LogWarning(GenerateDisabledNetworkBehaviourWarning(networkBehaviours[i]));
26452650
continue;
26462651
}
26472652

0 commit comments

Comments
 (0)