Skip to content

Commit eb40ac0

Browse files
Merge branch 'fix/spawn-disabled-in-scene-placed-and-network-prefab-registration' of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects into fix/spawn-disabled-in-scene-placed-and-network-prefab-registration
2 parents 34a6b8d + c484ce7 commit eb40ac0

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,14 +1911,14 @@ private void SpawnInternal(bool destroyWithScene, ulong ownerClientId, bool play
19111911
#pragma warning restore CS0618 // Type or member is obsolete
19121912

19131913
// If the initial state of the GameObject was disabled and InScenePlaced is marked,
1914-
// then spawn it as in-scene placed.[MTT-15388]
1914+
// then spawn it as in-scene placed.
19151915
// Otherwise:
19161916
// If we are marked as in-scene place, have never been spawned, and the root GameObject
19171917
// was not disabled upon being instantiated, then treat this as a dynamically spawned
19181918
// instance.
19191919
if (InScenePlaced && !m_InScenePlacedDisabledByDefault && !HasBeenSpawned)
19201920
{
1921-
if (NetworkManagerOwner.NetworkConfig.EnableSceneManagement && NetworkManagerOwner.LogLevel <= LogLevel.Developer)
1921+
if (NetworkManagerOwner.NetworkConfig.EnableSceneManagement && NetworkManagerOwner.LogLevel <= LogLevel.Normal)
19221922
{
19231923
Debug.LogWarning($"[{name}][SceneOrigin={SceneOriginHandle}] Dynamically spawning InScenePlaced network object. This can cause issues!", this);
19241924
}

com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,9 +1617,9 @@ internal void ServerSpawnSceneObjectsOnStartSweep()
16171617
// If this isn't the original prefab asset being skipped over (integration test would be a good example), then log the error.
16181618
if (!NetworkManager.NetworkConfig.Prefabs.IsActualPrefabAsset(networkObject))
16191619
{
1620-
NetworkManager.Log.Error(new Context(LogLevel.Error, $"{networkObject.name} appears to be a pre-instantiated {nameof(GameObject)} " +
1621-
$"with a {nameof(NetworkObject)} component instance that is not a registered prefab nor is it an in-scene placed {nameof(NetworkObject)}." +
1622-
$" Dynamically creating unregistered {nameof(NetworkObject)}s is not supported! {networkObject.name} will not be spawned."));
1620+
NetworkManager.Log.Error(new Context(LogLevel.Error, $"Detected a pre-instantiated {nameof(GameObject)} " +
1621+
$"with a {nameof(NetworkObject)} component instance that is not a registered prefab nor an in-scene placed {nameof(NetworkObject)}." +
1622+
$" Dynamically creating unregistered {nameof(NetworkObject)}s is not supported! This {nameof(NetworkObject)} will not be spawned.").AddNetworkObject(networkObject));
16231623
}
16241624
continue;
16251625
}

0 commit comments

Comments
 (0)