mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-30 04:57:10 +01:00
fixed inputfields
This commit is contained in:
@@ -34,6 +34,7 @@ public class InputValidator : MonoBehaviour
|
||||
|
||||
private void ValueChangeCheck()
|
||||
{
|
||||
//IP
|
||||
if(InputType == TypeOfInput.IP)
|
||||
{
|
||||
int counter = 0;
|
||||
@@ -98,6 +99,7 @@ public class InputValidator : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
// USERNAME
|
||||
if (InputType == TypeOfInput.Username)
|
||||
{
|
||||
|
||||
|
||||
@@ -8,14 +8,17 @@ public class MenuStartClient : MonoBehaviour
|
||||
[SerializeField] private TMP_InputField UsernameInput;
|
||||
public void StartClient()
|
||||
{
|
||||
if(UsernameInput.text != null)
|
||||
if(UsernameInput.text != "")
|
||||
{
|
||||
Debug.Log("[MENU] Starting client...");
|
||||
|
||||
GameObject.FindGameObjectWithTag("VariableSaver").GetComponent<VariableSaver>().username = UsernameInput.text;
|
||||
|
||||
NetworkManager.singleton.networkAddress = IpInput.text;
|
||||
NetworkManager.singleton.StartClient();
|
||||
if(IpInput.text != "")
|
||||
{
|
||||
NetworkManager.singleton.StartClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ public class MenuStartHost : MonoBehaviour
|
||||
[SerializeField] private TMP_InputField UsernameInput;
|
||||
public void StartHost()
|
||||
{
|
||||
if (UsernameInput.text != null)
|
||||
if (UsernameInput.text != "")
|
||||
{
|
||||
Debug.Log("[MENU] Starting host...");
|
||||
GameObject.FindGameObjectWithTag("VariableSaver").GetComponent<VariableSaver>().username = UsernameInput.text;
|
||||
|
||||
Reference in New Issue
Block a user