public void Auth() { //The practitioners list are hard-coded now, because the authentication is just a proof-of-concept switch (PIN.text) { case "03825": PatientList.patientIds = "p100,p101,p102,p103,p104,p105,p106"; PatientList.practitionerName = "Maudie"; switchScene(); break; case "03826": PatientList.patientIds = "p100,p107,p108,p109,p110"; PatientList.practitionerName = "Erlinda"; switchScene(); break; case "03827": PatientList.patientIds = "p100,p105,p110"; PatientList.practitionerName = "Jonah"; switchScene(); break; default: WarningInfo.text = "The PIN is wrong!"; PIN.Select(); PIN.text = ""; break; } }
/// <summary> /// Check if tab was clicked /// </summary> private void Update() { if (!Input.GetKeyDown(KeyCode.Tab)) { return; } // Check which input is currently focussed if (nameInput.isFocused) { directoryInput.Select(); } else if (directoryInput.isFocused) { importInput.Select(); } else if (importInput.isFocused) { nameInput.Select(); } else { nameInput.Select(); } }
public void ShowSellDialog(Npc npc) { PrepareDialog(); CurrentAction = Action.Selling; CurrentNpc = npc; CurrentNpcModel = npc.Model; CurrentAcceptAmountByNpc = CurrentNpcModel.InitialOfferAmount; CurrentOfferAmount = CurrentNpcModel.InitialOfferAmount; CurrentItemData = ItemFactory.Instance.GetDataFor(CurrentNpcModel.Item); CurrentOfferAmount = CurrentNpcModel.InitialOfferAmount; _actionTextField.text = "Selling"; _itemImage.sprite = CurrentItemData.sprite; var npcText = InterpolateText(_sellingDialogs[UnityEngine.Random.Range(0, _sellingDialogs.Length)]); _npcTextField.text = npcText; _amountInputField.Select(); _panelCanvasGroup.DOFade(1, .35f); UserCanInput = true; }
private void HandleCommandInputFieldNavigation() { if (Input.GetKeyDown(KeyCode.UpArrow)) { commandInputField.Select(); if (commandHistory.Count == 0) { return; } historyIndex++; historyIndex = Mathf.Clamp(historyIndex, 0, commandHistory.Count - 1); commandInputField.text = commandHistory[historyIndex]; } if (Input.GetKeyDown(KeyCode.DownArrow)) { commandInputField.Select(); if (commandHistory.Count == 0) { return; } historyIndex--; historyIndex = Mathf.Clamp(historyIndex, 0, commandHistory.Count - 1); commandInputField.text = commandHistory[historyIndex]; } }
// Update is called once per frame void Update() { if (first) { bool firstEnemy = true; int count = -1; foreach (SimulationEnemy se in sm.Enemies) { if (firstEnemy) { EnemyText = GameObject.Find("InfoPanel").transform.Find("Enemy").gameObject; //EnemyText.transform.Find("Value").gameObject.GetComponent<TextMeshPro>().text = "||||||||||"; EnemyHealth.Add(se, EnemyText); firstEnemy = false; } else { GameObject go = Instantiate(EnemyText, new Vector3(EnemyText.transform.position.x, (EnemyText.transform.position.y - 10f - 30f * count++) * Multi, 0), Quaternion.identity, GameObject.Find("InfoPanel").transform); EnemyHealth.Add(se, go); } } first = false; } foreach (var pair in EnemyHealth) { SimulationEnemy se = pair.Key; GameObject go = pair.Value; if (se.health > 0) { go.transform.Find("Value").GetComponent <TextMeshProUGUI>().text = "||||||||||".Substring(0, (int)(se.health / se.maxHealth * 10f)); } else { go.transform.Find("Value").GetComponent <TextMeshProUGUI>().text = ""; } } Hull.text = Math.Round(sm.pm.health, 1).ToString(); Heat.text = Math.Round(sm.pm.currentHeat, 1).ToString(); input.Select(); if (Input.GetKeyDown(KeyCode.Return)) { string inputString = input.text; if (inputString.ToLower() == "enemy") { StartCoroutine(EnemyLog()); } if (inputString.ToLower() == "player") { StartCoroutine(PlayerLog()); } if (inputString.ToLower() == "turn") { NextTurn(); } input.text = ""; input.ActivateInputField(); input.Select(); } }
// Use this for initialization void Start() { image = GetComponent <Image>(); input.Select(); lines = new string[6]; setLines(); startMenu = transform.parent.gameObject; }
void Start() { userData.ResetLocalUserData(); if (loginWindow.activeSelf) { username.Select(); } }
IEnumerator SelectChatInput() { yield return(null); yield return(null); InputFieldChat.Select(); InputFieldChat.ActivateInputField(); }
void DoUndo() { if (undoinputfieldstack.Count >= 2) { undoinputfieldstack.Pop(); redoinputfieldstack.Push(CodeInputField.text); CodeInputField.text = undoinputfieldstack.Pop(); CodeInputField.Select(); recordtimer = undorecorddelay; } }
void Update() { if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return)) { ReadData(); historyCommands.Add(currentCommand.text); currentCommand.text = ""; index = historyCommands.Count; currentCommand.ActivateInputField(); //Re-focus on the input field currentCommand.Select(); //Re-focus on the input field } if (Input.GetKeyDown(KeyCode.UpArrow)) { if (historyCommands.Count > 0) { if (index > 0) { index--; } else { index = historyCommands.Count - 1; } currentCommand.text = historyCommands[index]; } } if (Input.GetKeyDown(KeyCode.DownArrow)) { if (historyCommands.Count > 0) { if (index < historyCommands.Count - 1) { index++; } else { index = 0; } currentCommand.text = historyCommands[index]; } } if (Input.GetKeyDown(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.C)) { password = false; tempDirectory = null; history.text += "\n"; currentDirectory = directories.Find(e => e.directoryName == "192.168.0.2"); } }
void Update() { if (menuHolder.activeSelf) { // Force name input field to remain focused if (!chipNameField.isFocused) { chipNameField.Select(); // Put caret at end of text (instead of selecting the text, which is annoying in this case) chipNameField.caretPosition = chipNameField.text.Length; } } }