Skip to content

Commit f1537a8

Browse files
committed
docs(networking-manager): Fixed code formatting
1 parent e331d86 commit f1537a8

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

docs/_docs/core-components/networking-manager.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,22 @@ NetworkingManager.Singleton.GetComponent<UnetTransport>().ConnectPort = 12345;
2626
Disconnecting is rather simple, but you have to remember, that you cannot use the ```NetworkSceneManager``` for scene switching in most Disconnecting cases. As soon as you stop the Client, Server or Host you have to use UnityEngine.SceneManagement instead.
2727
```csharp
2828
public void Disconnect()
29-
{
30-
if (IsHost) {
31-
NetworkingManager.Singleton.StopHost();
32-
}
33-
34-
else if (IsClient) {
35-
NetworkingManager.Singleton.StopClient();
36-
}
37-
38-
else if (IsServer) {
39-
NetworkingManager.Singleton.StopServer();
40-
}
41-
UnityEngine.SceneManagement.SceneManager.LoadScene("MainMenu");
42-
}
29+
{
30+
if (IsHost)
31+
{
32+
NetworkingManager.Singleton.StopHost();
33+
}
34+
else if (IsClient)
35+
{
36+
NetworkingManager.Singleton.StopClient();
37+
}
38+
else if (IsServer)
39+
{
40+
NetworkingManager.Singleton.StopServer();
41+
}
42+
43+
UnityEngine.SceneManagement.SceneManager.LoadScene("MainMenu");
44+
}
4345
```
4446

4547
The only case where you could use the ```NetworkSceneManager``` for disconnecting, would be if the Server/Host switches back to MainMenu or similar for everyone and then Stopping the Server and all the Clients.

0 commit comments

Comments
 (0)