You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/core-components/networking-manager.md
+43-8Lines changed: 43 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,46 @@ title: NetworkingManager
3
3
permalink: /wiki/networking-manager/
4
4
---
5
5
6
-
<divclass="panel panel-warning">
7
-
<div class="panel-heading">
8
-
<h3 class="panel-title"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Not yet written</h3>
9
-
</div>
10
-
<div class="panel-body">
11
-
This page is not yet written, or it's documentation is incomplete. The MLAPI is a community project, if you want to contribute to the documentation, please do so to benefit everyone
12
-
</div>
13
-
</div>
6
+
The NetworkingManager is a script component handling all your Networking related settings, your Networked Prefabs and your registered scene names. A Transport component is needed on the same GameObject. It is responsible for handling IP adresses and additional settings.
7
+
8
+
### Starting a Server, Host or Client
9
+
The NetworkingManager allows you to start/stop the Networking. It provides the same functions for Server, Host and Client.
10
+
The Host functions as Server and Client simultaneously.
11
+
```csharp
12
+
NetworkingManager.Singleton.StartServer(); //or
13
+
NetworkingManager.Singleton.StartHost(); //or
14
+
NetworkingManager.Singleton.StartClient();
15
+
```
16
+
17
+
### Connecting
18
+
When Starting a Client, the NetworkingManager uses the IP and the Port provided in your "Transport" component for connecting.
19
+
You can use different transports and have to replace the type inside the following GetComponent<> accordingly, but for UNET transport it looks like this:
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.
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