private void Update() { if (!inputField.interactable || !inputField.isFocused || inputField.navigation.mode == Navigation.Mode.None) { return; } if (!Input.GetKeyDown(KeyCode.Tab)) { return; } Selectable target = null; switch (moveDirection) { case MoveDirection.Left: target = inputField.FindSelectableOnLeft(); break; case MoveDirection.Up: target = inputField.FindSelectableOnUp(); break; case MoveDirection.Right: target = inputField.FindSelectableOnRight(); break; case MoveDirection.Down: target = inputField.FindSelectableOnDown(); break; } if (target) { target.Select(); } }
// Update is called once per frame void Update() { if (GameManager.gameStage != GameStage.Login) { return; } if (!loginshown) { if (Network.LoginConnected) { ShowLoginBox(); } Network.LoginManager = this; } else { if (!MessageBox.gameObject.activeSelf) { if (Input.GetKeyDown(KeyCode.Tab)) { GameObject current = EventSystem.current.currentSelectedGameObject; if (current != null) { TMP_InputField input = current.GetComponent <TMP_InputField>(); if (input != null) { Selectable next = input.FindSelectableOnDown(); if (next != null) { next.Select(); } } } } if (Input.GetKeyDown(KeyCode.Return)) { string username = UserName.text; string password = Password.text; if (username != string.Empty && password != string.Empty) { LoginButton_OnClick(); } } } } /*if (Input.GetMouseButtonDown(0)) * { * LoginSuccess(); * }*/ }