Skip to content

Commit 9038909

Browse files
update
Adding additional log information only displayed when the log level is Developer.
1 parent c6315ce commit 9038909

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

com.unity.netcode.gameobjects/Runtime/Components/Helpers/NetworkObjectBridge.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,24 @@ internal class UnifiedBootStrap : ClientServerBootstrap
7676

7777
public override bool Initialize(string defaultWorldName)
7878
{
79+
var networkManager = NetworkManager.Singleton;
7980
Instance = this;
8081
AutoConnectPort = Port;
81-
if (NetworkManager.Singleton.IsServer)
82+
if (networkManager.IsServer)
8283
{
8384
CreateSingleWorldHost("ClientAndServerWorld");
85+
if (networkManager.LogLevel <= LogLevel.Developer)
86+
{
87+
UnityEngine.Debug.Log("Creating world: ClientAndServerWorld");
88+
}
8489
}
8590
else
8691
{
8792
CreateClientWorld("ClientWorld");
93+
if (networkManager.LogLevel <= LogLevel.Developer)
94+
{
95+
UnityEngine.Debug.Log("Creating world: ClientWorld");
96+
}
8897
}
8998
var initialized = base.Initialize(defaultWorldName);
9099
OnInitialized?.Invoke(initialized);

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,11 @@ private System.Collections.IEnumerator WaitForHybridPrefabRegistration(StartType
13231323
{
13241324
yield return null;
13251325
}
1326-
1326+
if (LogLevel <= LogLevel.Developer)
1327+
{
1328+
Debug.Log("All hybrid prefabs have been registered!");
1329+
Debug.Log("Finalizing NetworkManager start...");
1330+
}
13271331
switch (startType)
13281332
{
13291333
case StartType.Server:
@@ -1395,7 +1399,10 @@ public bool StartServer()
13951399
ShutdownInternal();
13961400
return false;
13971401
}
1398-
1402+
if (LogLevel <= LogLevel.Developer)
1403+
{
1404+
Debug.Log("Creating world: Default world");
1405+
}
13991406
DefaultWorldInitialization.Initialize("Default World", false);
14001407
StartCoroutine(WaitForHybridPrefabRegistration(StartType.Server));
14011408
return true;
@@ -1470,6 +1477,10 @@ public bool StartClient()
14701477
ShutdownInternal();
14711478
return false;
14721479
}
1480+
if (LogLevel <= LogLevel.Developer)
1481+
{
1482+
Debug.Log("Creating world: Default world");
1483+
}
14731484
DefaultWorldInitialization.Initialize("Default World", false);
14741485
StartCoroutine(WaitForHybridPrefabRegistration(StartType.Client));
14751486
// TODO-UNIFIED: Need a way to signal everything completed.
@@ -1544,6 +1555,10 @@ public bool StartHost()
15441555
ShutdownInternal();
15451556
return false;
15461557
}
1558+
if (LogLevel <= LogLevel.Developer)
1559+
{
1560+
Debug.Log("Creating world: Default world");
1561+
}
15471562
DefaultWorldInitialization.Initialize("Default World", false);
15481563
StartCoroutine(WaitForHybridPrefabRegistration(StartType.Host));
15491564
// TODO-UNIFIED: Need a way to signal everything completed.

0 commit comments

Comments
 (0)