コード例 #1
0
    public bool ValidateTextBoxes()
    {
        bool response = true;

        InputField[] inputs = FindObjectsOfType <InputField>();

        foreach (InputField input in inputs)
        {
            if (input.text.Contains(" "))
            {
                netManager.Alert("No Spaces Allowed in Username", "Status");
                response = false;
            }
            else if (string.IsNullOrEmpty(input.text))
            {
                netManager.Alert("Please type in something", "Status");
                response = false;
            }
            else
            {
                netManager.Alert("", "Status");
                response = true;
            }
        }
        return(response);
    }