· 6 years ago · Oct 22, 2019, 11:26 AM
1using UnityEngine;
2using UnityEngine.UI;
3
4public class UIController : MonoBehaviour
5{
6 private string _mailForm = "@gmail.com";
7 private InputField _inputField;
8
9 private void Start()
10 {
11 _inputField = gameObject.GetComponentInChildren(typeof(InputField)) as InputField;
12 }
13
14 public void ApplyButton()
15 {
16 if (_inputField.text.Length > _mailForm.Length && _inputField.text.EndsWith(_mailForm))
17 {
18 Debug.Log(_inputField.text);
19 }
20 }
21}