void Start() { QA.preguntasResueltas = new bool[QA.respuestas.Length]; GeneratorQA(); cajaRespuesta.ActivateInputField(); textoResultado.text = ""; }
// Start is called before the first frame update void Start() { currentPasswordQuery = World.DefaultGameObjectInjectionWorld.EntityManager.CreateEntityQuery(typeof(CurrentPassword)); input.ActivateInputField(); input.onDeselect.AddListener(OnDeselect); input.onSubmit.AddListener(OnSubmit); }
void Update() { if (!isLocalPlayer) { return; } if (Input.GetKeyDown(KeyCode.Return)) { OnSubmit(_inputField.text); _latestCommandIndex = _latestCommands.Count; } if (Input.GetKeyDown(KeyCode.UpArrow)) { if (_latestCommandIndex > 0) { _latestCommandIndex--; _inputField.text = _latestCommands[_latestCommandIndex]; _inputField.ActivateInputField(); } } if (Input.GetKeyDown(KeyCode.DownArrow)) { if (_latestCommandIndex < _latestCommands.Count - 1) { _latestCommandIndex++; _inputField.text = _latestCommands[_latestCommandIndex]; _inputField.ActivateInputField(); } } }
// Start is called before the first frame update void Start() { if (messageInput != null) { messageInput.ActivateInputField(); } }
private void OnInputChanged(string newValue) { _autoCompleteTemplate.Clear(); _autoCompleteIndex = -1; if (!_dontResetHistoryIndex) { _historyIndex = -1; } _dontResetHistoryIndex = false; var entries = DevConsole.GetEntriesStartingWith(newValue); foreach (var entry in entries) { var data = new AutoCompleteEntryData() { Name = entry.Name, Description = entry.Description, Value = DevConsole.GetVariableAsString(entry.Name), OnClick = () => { _input.text = $"{entry.Name} "; _input.ActivateInputField(); StartCoroutine(MoveToEndOfInput()); } }; _autoCompleteTemplate.Append(data); } }
public void Initialize() { RaycastHit hit; Physics.Raycast(FirstPersonInteraction.Ray(), out hit, Settings.ReachDistance, Wire.IgnoreWiresLayermask); if (hit.collider == null || (hit.collider.tag != "CircuitBoard" && hit.collider.tag != "World" && hit.collider.tag != "PlaceOnlyBoard")) // all valid tags of things to place on { SoundPlayer.PlaySoundGlobal(References.Sounds.FailDoSomething); GameplayUIManager.UIState = UIState.None; return; } GameplayUIManager.UIState = UIState.NewBoardMenu; // to make sure there's no disconnect between the UI and the what it represents SizeXSlider.value = SizeX; SizeYSlider.value = SizeY; SizeXInput.text = SizeX.ToString(); SizeYInput.text = SizeY.ToString(); NewBoardCanvas.enabled = true; // select the size x input field so that the user can immediately begin typing SizeXInput.ActivateInputField(); }
IEnumerator ToggleVisibilityCoroutine(bool makeVisible, bool immediately) { if (makeVisible) { panel.GetComponentInParent <Canvas>().enabled = true; } else { input.interactable = false; } float t = immediately ? 1f : 0f; while (t <= 1f) { t += Time.unscaledDeltaTime * appearSpeed; panel.GetComponent <Animator>().SetFloat("Appeared", makeVisible ? t : 1f - t); if (t <= 1f) { yield return(null); } } if (!makeVisible) { panel.GetComponentInParent <Canvas>().enabled = false; } else { input.interactable = true; input.ActivateInputField(); } yield break; }
void ExecuteCommand(string command) { if (input.wasCanceled) { input.ActivateInputField(); return; } input.text = ""; input.ActivateInputField(); if (command.Length != 0) { m_previousCommands.Insert(0, command); } m_previousCommandSelected = -1; bool exception = false; try{ PythonUtils.GetEngine().Execute(command, m_scope); }catch (Exception e) { exception = true; // Debug.LogException (e); write(e.Message); } text.text += "\n<b>" + (exception ? "<color=#d22>" : "") + command + (exception ?"</color=#f66>" : "") + "</b> "; text.text += log; log = ""; scroll.verticalNormalizedPosition = 0f; }
private void OnEnterPerformed(InputAction.CallbackContext context) { // Properties when command requires a parameter string[] properties = inputField.text.Split(' '); // Iterate through list of commands foreach (DebugCommandBase debugCommand in debugCommands.Cast <DebugCommandBase>().Where(debugCommand => inputField.text.Contains(debugCommand.Format))) { switch (debugCommand) { case DebugCommand command: command.Invoke(); return; case DebugCommand <int> command1: command1.Invoke(int.Parse(properties[1])); return; } } // If none match then said invalid command inputField.text = "Invalid command"; // Reactivate input field inputField.ActivateInputField(); }
/// <summary> /// Update is called every frame, if the MonoBehaviour is enabled. /// </summary> private void Update() { if (Input.GetKeyDown(KeyCode.BackQuote)) { if (m_consoleViewContainer.activeInHierarchy) { JITimer.Instance.TimeScale = _prevTimeScale; m_consoleViewContainer.SetActive(false); FindObjectOfType <PlayerMove> ().enabled = true; } else { _prevTimeScale = JITimer.Instance.TimeScale; JITimer.Instance.TimeScale = 0f; m_consoleViewContainer.SetActive(true); m_inputField.text = ""; m_inputField.ActivateInputField(); FindObjectOfType <PlayerMove> ().enabled = false; } } if (m_consoleViewContainer.activeInHierarchy) { JITimer.Instance.TimeScale = 0f; } }
void viewQuest(Quest _quest, bool image) { progressBar.fillAmount = currentProgress / numberOfQuestions; if (image) { questText.enabled = false; questImage.enabled = true; questImage = _quest.image; } else { questText.enabled = true; questImage.enabled = false; if (PlayerPrefs.GetInt("Ita-lat") == 0) { questText.text = _quest.italian; } else { questText.text = _quest.latin; } } inputField.text = ""; inputField.ActivateInputField(); }
private void ProcessInput(string input) { console.SendInput(this, input); console.ResetHistoryNavigation(); inputField.text = string.Empty; inputField.ActivateInputField(); }
public void Toggle(CallbackContext context) { if (!context.action.triggered || GetComponent <UIManager>().meetingMenu.activeInHierarchy) { return; } if (chatInput.gameObject.activeSelf) { GameObject.Find("Local").GetComponent <PlayerMovementController>().EnableControls(); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; chatInput.gameObject.SetActive(false); } else { GameObject.Find("Local").GetComponent <PlayerMovementController>().DisableControls(); Cursor.lockState = CursorLockMode.None; Cursor.visible = true; chatInput.gameObject.SetActive(true); chatInput.ActivateInputField(); } }
public void InitAsWritableNote(string originalContent, Action <string> onSubmitButtonClicked, Action onCancelButtonClicked) { m_InputField.interactable = true; m_InputField.text = originalContent; m_OnSaveButtonClicked = onSubmitButtonClicked; m_OnCancelButtonClicked = onCancelButtonClicked; m_InputField.ActivateInputField(); }
// Call me to open the console void OpenConsole() { // Open the console prevIndex = 0; consoleContainer.SetActive(true); consoleInput.ActivateInputField(); // src: https://forum.unity.com/threads/unity-4-6-ui-how-to-prevent-deselect-losing-focus-in-inputfield.272387#post-1922941 (24 Jan 2018) consoleOpen = true; }
public void ChangeName() { buttonAudio.Play(0); invalidName.CrossFadeAlpha(0f, 0f, false); layer2.SetActive(true); playerNameInput.Select(); playerNameInput.ActivateInputField(); }
void ShowInput() { scrollview.gameObject.SetActive(true); floatingScrollview.gameObject.SetActive(false); inputField.gameObject.SetActive(true); inputField.ActivateInputField(); PlayerController.LockCursor(false); }
public void Activate() { loading = false; console_InputField.ActivateInputField(); focus = "console"; }
public async void Login() { var AM = AppManager.Instance; if (Lean.Localization.LeanLocalization.CurrentLanguage == "English") { AM.userInfo.user.lang = "en"; } else { AM.userInfo.user.lang = "ru"; } UserAuth auth = new UserAuth($"{login.text}:{pass.text}:{AM.userInfo.user.lang}"); await WebRequests.Request.RequestPost("user/login", JsonUtility.ToJson(auth), (code, response) => { if (code == 200) { Debug.Log(response.Replace('"', ' ').Trim()); AppManager.Instance.userInfo.access_token = response.Replace('"', ' ').Trim(); if (AppManager.Instance.userInfo.access_token == "false") { pass.contentType = TMP_InputField.ContentType.Standard; pass.ActivateInputField(); if (Lean.Localization.LeanLocalization.CurrentLanguage == "English") { pass.text = "Wrong password. Try again"; } else { pass.text = "Неверный пароль. Повторите попытку"; } } else { WebRequests.Request.RequestPost("user/update", JsonUtility.ToJson(AM.userInfo), (code1, respons1e) => { Debug.Log("code1 " + code1); Debug.Log("respons1e " + respons1e); JsonUtility.FromJsonOverwrite(response, AppManager.Instance); }, true); PlayerPrefs.SetString("Token", response.Replace('"', ' ').Trim()); PlayerPrefs.SetString("pass", pass.text); PlayerPrefs.Save(); AppManager.Instance.BottomBar.SetActive(true); AppManager.Instance.SwitchScreen(3); } } }, false); while (AppManager.Instance.userInfo.access_token.Length == 0) { await new WaitForSeconds(0.01f); } await WebRequests.Request.RequestGet("getdata?action=mydata", (code, response) => { JsonUtility.FromJsonOverwrite(response, AppManager.Instance); }, true); }
void OnEnable() { if (TextField != null) { TextField.ActivateInputField(); //TextField.caretPosition = TextVariable.Length; TextField.stringPosition = TextVariable.Length; } }
private void SetVisibility(bool visibilty) { consoleCanvas.SetActive(visibilty); if (visibilty == true) { inputField.ActivateInputField(); } }
private void Message() { string message = input.text; networkObject.SendRpc(RPC_RECIVE_MESSAGE, Receivers.All, username, userColour, message); input.text = ""; input.ActivateInputField(); input.Select(); }
private void OnSubmit(string input) { if (string.IsNullOrEmpty(input) == false && string.IsNullOrWhiteSpace(input) == false) { ConsoleSignals.InvokeOnInput(input); } inputField.ActivateInputField(); inputField.text = ""; }
/// <summary> /// Toggles the in-game viewable console /// </summary> public void ToggleConsole() { consolePanel.SetActive(!IsOpen()); if (IsOpen()) { inputField.ActivateInputField(); } }
private void Update() { if (_updated) { InputField.onEndEdit.Invoke(""); _updated = false; } InputField.ActivateInputField(); }
void Start() { roomInput.onValidateInput = ValidateRoom; nameInput.onValidateInput = ValidateName; roomInput.onSubmit.AddListener(Next); nameInput.onSubmit.AddListener(Submit); canvasGroup.alpha = 0; roomInput.ActivateInputField(); }
private void OpenConsole() { console.gameObject.SetActive(value: true); console.Select(); console.ActivateInputField(); Cursor.lockState = CursorLockMode.None; Cursor.visible = true; PlayerMovement.Instance.paused = true; Time.timeScale = 0f; }
void Start() { currentNode.visited = true; //if (activeState == GameState.Startup) //{ // putInQueue(startupText); // fadeTo(Color.black, 0, 4); //} updateCurrentInteractables(currentNode); inputField.ActivateInputField(); slidePosY = contentRect.anchoredPosition.y; DataManager.loadFiles(); updateArrowKeys(currentNode); fadeArrowKeys(1); audioSource.gameObject.SetActive(true); changeState(GameState.TakeInput); putInQueue(startingLines); exitNode.gameObject.SetActive(false); }
void Start() { if (terminal != null) { terminal.logChanged += OnLogChanged; } updateLogStr(terminal.log); inputField.Select(); inputField.ActivateInputField(); }
void Submit() { string message = inputField.text; if (!string.IsNullOrWhiteSpace(message) && message.Length > 0) { photonView.RPC("SendChat", RpcTarget.All, $"<b>{PhotonNetwork.LocalPlayer.NickName}</b>: {message}", ChatMessageType.PlayerMessage); inputField.text = ""; inputField.ActivateInputField(); } }