This commit is contained in:
DerTyp187
2021-11-01 08:45:45 +01:00
parent 5921e33205
commit 30a30d7ef5
6 changed files with 192 additions and 99 deletions

View File

@@ -0,0 +1,18 @@
using Mirror;
using UnityEngine;
public class JoinLeaveManager : MonoBehaviour
{
private NetworkManager networkManager;
public void Join(string ip, string username)
{
networkManager = GetComponent<NetworkManager>();
Debug.Log("[JoinLeaveManager] Trying to join server: " + ip + " as " + username);
networkManager.StartClient();
networkManager.networkAddress = ip;
Debug.Log("[JoinLeaveManager] " + username + " joined the server: " + ip);
}
}