mirror of
				https://github.com/DerTyp7/defrain-shooter-unity.git
				synced 2025-11-03 22:58:59 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			671 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			671 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 != "")
 | 
						|
        {
 | 
						|
            Debug.Log("[MENU] Starting client...");
 | 
						|
 | 
						|
            GameObject.FindGameObjectWithTag("VariableSaver").GetComponent<VariableSaver>().username = UsernameInput.text;
 | 
						|
 | 
						|
            NetworkManager.singleton.networkAddress = IpInput.text;
 | 
						|
            if(IpInput.text != "")
 | 
						|
            {
 | 
						|
                NetworkManager.singleton.StartClient();
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |