mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 21:17:09 +01:00
Merging
This commit is contained in:
24
Assets/Scripts/HomeMenu/MenuStartClient.cs
Normal file
24
Assets/Scripts/HomeMenu/MenuStartClient.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Mirror;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class MenuStartClient : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_InputField IpInput;
|
||||
[SerializeField] private TMP_InputField UsernameInput;
|
||||
public void StartClient()
|
||||
{
|
||||
if(UsernameInput.text != "")
|
||||
{
|
||||
Debug.Log("[MENU] Starting client...");
|
||||
|
||||
GameObject.FindGameObjectWithTag("VariableSaver").GetComponent<VariableSaver>().username = UsernameInput.text;
|
||||
|
||||
NetworkManager.singleton.networkAddress = IpInput.text;
|
||||
if(IpInput.text != "")
|
||||
{
|
||||
NetworkManager.singleton.StartClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user