mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 21:17:09 +01:00
idk
This commit is contained in:
@@ -7,14 +7,22 @@ public class JoinBtnScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_InputField inputIp;
|
||||
[SerializeField] private TMP_InputField inputUsername;
|
||||
private GameObject GameManager;
|
||||
private NetworkManager networkManager;
|
||||
public GameObject localPlayer;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
gameObject.GetComponent<Button>().onClick.AddListener(JoinServer);
|
||||
GameManager = GameObject.Find("GameManager");
|
||||
networkManager = GameManager.GetComponent<NetworkManager>();
|
||||
}
|
||||
|
||||
public void JoinServer()
|
||||
{
|
||||
NetworkClient.Connect(inputIp.text);
|
||||
networkManager.StartClient();
|
||||
networkManager.networkAddress = inputIp.text;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user