// Update is called once per frame void Update() { if (this.isActiveAndEnabled & !TacoManager.CheckModalsOpen()) { if (Input.GetKeyDown(KeyCode.Tab)) { if (EmailInput.GetComponent <InputField> ().isFocused) { PasswordInput.GetComponent <InputField> ().ActivateInputField(); } if (PasswordInput.GetComponent <InputField> ().isFocused) { EmailInput.GetComponent <InputField> ().ActivateInputField(); } else if (!EmailInput.GetComponent <InputField> ().isFocused&& !PasswordInput.GetComponent <InputField> ().isFocused) { EmailInput.GetComponent <InputField> ().ActivateInputField(); } } else if (Input.GetKeyDown(KeyCode.Return)) { Login(); } } }
// Update is called once per frame void Update() { if (this.isActiveAndEnabled & !TacoManager.CheckModalsOpen()) { if (Input.GetKeyDown(KeyCode.Return)) { TacoManager.ShowPanel(PanelNames.MyPublicPanel); } } }
// Update is called once per frame void Update() { if (this.isActiveAndEnabled & !TacoManager.CheckModalsOpen()) { if (Input.GetKeyDown(KeyCode.Return)) { TournamentManager.Instance.ShowTournamentPanel(); } } }
// Update is called once per frame void Update() { if (this.isActiveAndEnabled && !TacoManager.CheckModalsOpen()) { if (Input.GetKeyDown(KeyCode.Return)) { // TODO find a better way - give the button focus and let the button handle the keypress if (TacoManager.CreatePublicPanel.activeInHierarchy) { StartCreate(); } } } }
// Update is called once per frame void Update() { if (countdownTime >= 0) { TournamentRemainingTime(); } if (isActiveAndEnabled & !TacoManager.CheckModalsOpen()) { if (Input.GetKeyDown(KeyCode.Return)) { TournamentManager.Instance.ShowTournamentPanel(); } } }
// Update is called once per frame void Update() { if (this.isActiveAndEnabled & !TacoManager.CheckModalsOpen()) { // validate requirements RegisterButtonImage.sprite = NotOkay; bool emailValidated = false; bool userValidated = false; bool passwordValidated = false; if (PasswordInput.GetComponent <InputField> ().text == "" || ConfirmInput.GetComponent <InputField> ().text == "") { StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage04; } if (UserInput.GetComponent <InputField> ().text == "") { StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage03; } if (UserInput.GetComponent <InputField> ().text != "") { userValidated = true; UserOkay.SetActive(true); } else { userValidated = false; StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage03; UserOkay.SetActive(false); } if (string.IsNullOrEmpty(EmailInput.GetComponent <InputField> ().text)) { emailValidated = false; EmailOkay.SetActive(false); StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage06; } else { var textEmail = EmailInput.GetComponent <InputField> ().text; bool isEmail = TacoManager.ValidateEmail(textEmail); StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage01; if (isEmail == true) { emailValidated = true; StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage04; EmailOkay.SetActive(true); } else { emailValidated = false; StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage01; EmailOkay.SetActive(false); } } if (PasswordInput.GetComponent <InputField> ().text != "" && ConfirmInput.GetComponent <InputField> ().text != "") { if (ConfirmInput.GetComponent <InputField> ().text == PasswordInput.GetComponent <InputField> ().text) { if (PasswordInput.GetComponent <InputField> ().text.Length > 3) { passwordValidated = true; //StatusText.GetComponent<Text> ().text = ""; PasswordOkay.SetActive(true); ConfirmOkay.SetActive(true); } else { passwordValidated = false; StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage07; PasswordOkay.SetActive(false); ConfirmOkay.SetActive(false); } } else { passwordValidated = false; StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage00; PasswordOkay.SetActive(false); ConfirmOkay.SetActive(false); } } else { //StatusText.GetComponent<Text> ().text = TacoConfig.TacoRegisteredErrorMessage04; passwordValidated = false; PasswordOkay.SetActive(false); ConfirmOkay.SetActive(false); } // test all conditions if (userValidated && passwordValidated && emailValidated && AgeToggle.GetComponent <Toggle> ().isOn) { RegisterButtonImage.sprite = Okay; StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredAllOkay; } else if (userValidated && passwordValidated && emailValidated && !AgeToggle.GetComponent <Toggle> ().isOn) { StatusText.GetComponent <Text> ().text = TacoConfig.TacoRegisteredErrorMessage02; } else { RegisterButtonImage.sprite = NotOkay; } // turn off placeholders on focus if (this.isActiveAndEnabled & !TacoManager.CheckModalsOpen()) { // tab through inputs if (Input.GetKeyDown(KeyCode.Tab)) { if (UserInput.GetComponent <InputField> ().isFocused) { EmailInput.GetComponent <InputField> ().ActivateInputField(); } else if (EmailInput.GetComponent <InputField> ().isFocused) { PasswordInput.GetComponent <InputField> ().ActivateInputField(); } else if (PasswordInput.GetComponent <InputField> ().isFocused) { ConfirmInput.GetComponent <InputField> ().ActivateInputField(); } else if (ConfirmInput.GetComponent <InputField> ().isFocused) { UserInput.GetComponent <InputField> ().ActivateInputField(); } else { UserInput.GetComponent <InputField> ().ActivateInputField(); } } else if (Input.GetKeyDown(KeyCode.Return)) { Register(); } } } }