mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 04:57:10 +01:00
updated mirror added testofflinescene
This commit is contained in:
20
Assets/Scripts/TestOfflineScene/JoinBtnScript.cs
Normal file
20
Assets/Scripts/TestOfflineScene/JoinBtnScript.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Mirror;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class JoinBtnScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_InputField inputIp;
|
||||
[SerializeField] private TMP_InputField inputUsername;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
gameObject.GetComponent<Button>().onClick.AddListener(JoinServer);
|
||||
}
|
||||
|
||||
public void JoinServer()
|
||||
{
|
||||
NetworkClient.Connect(inputIp.text);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user