void Start() { // Define what to do with output from the interpreter. // We'll pass it to our output.PrintLine method, but wrap it in some color // tags depending on what sort of output it is. demoScript.interpreter.standardOutput = (string s) => output.PrintLine(s); demoScript.interpreter.implicitOutput = (string s) => output.PrintLine( "<color=#66bb66>" + s + "</color>"); demoScript.interpreter.errorOutput = (string s) => { Debug.LogWarning(s); output.PrintLine("<color=red>" + s + "</color>"); // ...and in case of error, we'll also stop the interpreter. demoScript.interpreter.Stop(); }; // Initialize the interpreter with our setup code. if (setupCode != null) { demoScript.RunScript(setupCode.text); } else { demoScript.RunScript(""); } UpdatePrompt(); input.ActivateInputField(); }
protected override void OnShown() { base.OnShown(); ifText.Select(); ifText.ActivateInputField(); }
static int ActivateInputField(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UnityEngine.UI.InputField obj = (UnityEngine.UI.InputField)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UnityEngine.UI.InputField"); obj.ActivateInputField(); return(0); }
static int ActivateInputField(IntPtr L) { L.ChkArgsCount(1); UnityEngine.UI.InputField obj = (UnityEngine.UI.InputField)L.ChkUnityObjectSelf(1, "UnityEngine.UI.InputField"); obj.ActivateInputField(); return(0); }
public void OnPressEnter() { string userInput = text.text; ActionCreator.Instance.AdvanceStory(userInput); ClearInputField(); inputField.ActivateInputField(); }
static public int ActivateInputField(IntPtr l) { try { UnityEngine.UI.InputField self = (UnityEngine.UI.InputField)checkSelf(l); self.ActivateInputField(); return(0); } catch (Exception e) { return(error(l, e)); } }
void ToggleControl() { if (!m_controlEnabled) { m_controlEnabled = true; m_InputField.enabled = true; m_PreviouslySelectedObject = EventSystem.current.currentSelectedGameObject; m_InputField.ActivateInputField(); } else { m_controlEnabled = false; m_InputField.enabled = false; EventSystem.current.SetSelectedGameObject(m_PreviouslySelectedObject); m_PreviouslySelectedObject = null; m_InputField.textComponent.text = "Control disabled, press Shift + ` to enable"; } }
/// <summary> /// Non-Propagating input event handler. Called on a view when it focuses. /// </summary> public override void HandleFocus() { base.HandleFocus(); // If the input field is not focused, focus it if (!InputFieldComponent.isFocused == true) { InputFieldComponent.ActivateInputField(); } UpdateState(); }
void gameOver() { if (isGameOver) { return; } isGameOver = true; gameOverText.text = "Score: " + score; gameOverText.enabled = true; gameOverCanvas.enabled = true; gameOverNameInput.Select(); gameOverNameInput.ActivateInputField(); }
static int ActivateInputField(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UnityEngine.UI.InputField obj = (UnityEngine.UI.InputField)ToLua.CheckObject <UnityEngine.UI.InputField>(L, 1); obj.ActivateInputField(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void InternalOpen() { if (!open) { open = true; inputField.enabled = true; ClearTildeKeyInput(); inputField.ActivateInputField(); inputField.MoveTextEnd(false); var fpsCounter = Bowhead.GameManager.instance.fpsCounter; if (fpsCounter != null) { fpsAnchor = fpsCounter.fpsCounter.Anchor; memAnchor = fpsCounter.memoryCounter.Anchor; gpuAnchor = fpsCounter.deviceInfoCounter.Anchor; fpsCounter.fpsCounter.Anchor = MoveAnchorToBottom(fpsCounter.fpsCounter.Anchor); fpsCounter.memoryCounter.Anchor = MoveAnchorToBottom(fpsCounter.memoryCounter.Anchor); fpsCounter.deviceInfoCounter.Anchor = MoveAnchorToBottom(fpsCounter.deviceInfoCounter.Anchor); } } }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Submit") == true) { if (activeField == false) { activeField = true; TextField.interactable = true; TextField.ActivateInputField(); TextField.Select(); walkingSpeed = SlowSpeed; } else { //submit and disable text box activeField = false; TextField.interactable = false; activeEnemyManager.CheckList(TextField.text); TextField.DeactivateInputField(); TextField.text = ""; walkingSpeed = NormalSpeed; } } if (Input.GetButtonDown("Shoot") && activeField == true) { //submit only. does not disable text box //Debug.Log(TextField.text + '+'); int strlen = TextField.text.Length; //Debug.Log(TextField.text.Substring(0, strlen - 1) + '+'); if (strlen > 0) { activeEnemyManager.CheckList(TextField.text.Substring(0, strlen - 1)); } TextField.text = ""; } if (Input.GetKeyDown(KeyCode.Comma)) { SceneManager.LoadScene(1); } }
// Update is called once per frame void Update() { if (Input.GetKeyUp(KeyCode.Return)) { var show = InputField.gameObject.activeSelf; if (!show) { InputField.text = ""; InputField.gameObject.SetActive(true); InputField.ActivateInputField(); } else { if (_EmotionSkill != null && InputField.text.Length > 0) { _EmotionSkill.Talk(InputField.text); } InputField.gameObject.SetActive(false); } } }
void Update() { if (Input.GetButtonDown("Edit Headlines")) { if (!inpu.enabled) { Debug.Log("input inactive"); inpu.text = ""; headline.text = "No Headline"; inpu.enabled = true; Debug.Log("activating input field"); inpu.ActivateInputField(); cameraControl.highlight(newsCam, true); } else { inpu.enabled = false; cameraControl.highlight(newsCam, false); } } }
void Update() { // Check for escape key press if (Input.GetKeyDown(KeyCode.Return)) { if (m_InputField == null) { return; } // Make sure we have input text if (!string.IsNullOrEmpty(m_InputField.text)) { // Make sure the return key is pressed if (Input.GetKey(KeyCode.Return)) { // Send the message this.SendChatMessage(m_InputField.text); } } else { //Show cursor var ctrl = FindObjectOfType <vThirdPersonInput>(); if (ctrl) { ctrl.ShowCursor(true); ctrl.LockCursor(true); ctrl.SetLockBasicInput(true); ctrl.SetLockCameraInput(true); } m_InputField.Select(); m_InputField.ActivateInputField(); } } }
// Use this for initialization void Start() { messageText.text = ""; usernameInput.ActivateInputField(); }
// Use this for initialization void Start() { messageText.text = ""; usernameInput.ActivateInputField(); showMessage("Connecting Server ..."); }
// Use this for initialization void Start() { ipAddressInput.ActivateInputField(); }
// Start is called before the first frame update void Start() { inputField.ActivateInputField(); }