mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 12:52:07 +01:00
Added the function "AuthHost" (lobby.cs) )which can be used to check if the request comes from a host
22 lines
606 B
C#
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();
|
|
}
|
|
}
|
|
}
|