Files
defrain-shooter-unity/Assets/Scripts/HomeMenu/MenuStartClient.cs
DerTyp187 c56f1d4a49 added Ready, NameChange, LobbyTitleChange
Added the function "AuthHost" (lobby.cs) )which can be used to check if the request comes from a host
2021-11-28 20:20:11 +01:00

22 lines
606 B
C#

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 != null)
{
Debug.Log("[MENU] Starting client...");
GameObject.FindGameObjectWithTag("VariableSaver").GetComponent<VariableSaver>().username = UsernameInput.text;
NetworkManager.singleton.networkAddress = IpInput.text;
NetworkManager.singleton.StartClient();
}
}
}