mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 21:17:09 +01:00
idk 2
This commit is contained in:
18
Assets/Scripts/GameManager/JoinLeaveManager.cs
Normal file
18
Assets/Scripts/GameManager/JoinLeaveManager.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user