/// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     isAwaitingInput = false;
     if (acceptedText != null) {
         if (textField != null) acceptedText(textField.text);
         acceptedText = null;
     }
     Hide();
 }
Пример #2
0
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     label.text                = labelText;
     inputField.text           = text;
     inputField.characterLimit = maxLength;
     m_acceptedText            = acceptedText;
     m_isAwaitingInput         = true;
     Show();
 }
		/// <summary>
		/// Starts the text input field.
		/// </summary>
		/// <param name="labelText">The label text.</param>
		/// <param name="text">The current value to use for the input field.</param>
		/// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
		/// <param name="acceptedText">The delegate to call when accepting text.</param>
		public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText) {
			if (label != null) label.text = labelText;
			if (textField != null) {
				textField.text = text;
				textField.characterLimit = maxLength;
			}
			this.acceptedText = acceptedText;
			Show();
			isAwaitingInput = true;
		}
Пример #4
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     isAwaitingInput = false;
     if (acceptedText != null)
     {
         //if (textField != null) acceptedText(textField.text);
         acceptedText = null;
     }
     Hide();
 }
Пример #5
0
		/// <summary>
		/// Starts the text input field.
		/// </summary>
		/// <param name="labelText">The label text.</param>
		/// <param name="text">The current value to use for the input field.</param>
		/// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
		/// <param name="acceptedText">The delegate to call when accepting text.</param>
		public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText) {
			Show();
			if (label != null) label.text = labelText;
			if (uiInput != null) {
				uiInput.defaultText = text;
				uiInput.characterLimit = maxLength;
				uiInput.value = text;
				uiInput.isSelected = true;
			}
			this.acceptedText = acceptedText;
		}
Пример #6
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 private void AcceptTextInput()
 {
     Hide();
     if (acceptedText != null)
     {
         if (textField != null)
         {
             acceptedText(textField.text);
         }
         acceptedText = null;
     }
 }
Пример #7
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     if (acceptedText != null)
     {
         if (uiInput != null)
         {
             acceptedText(uiInput.value);
         }
         acceptedText = null;
     }
     Hide();
 }
Пример #8
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     m_isAwaitingInput = false;
     if (m_acceptedText != null)
     {
         if (inputField != null)
         {
             m_acceptedText(inputField.text);
         }
         m_acceptedText = null;
     }
     Hide();
     onAccept.Invoke();
 }
Пример #9
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     isAwaitingInput = false;
     if (acceptedText != null)
     {
         if (textField != null)
         {
             acceptedText(textField.text);
         }
         acceptedText = null;
     }
     Hide();
     onAccept.Invoke();
 }
Пример #10
0
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null)
     {
         label.text = labelText;
     }
     if (textField != null)
     {
         textField.text           = text;
         textField.characterLimit = maxLength;
     }
     this.acceptedText = acceptedText;
     Show();
     isAwaitingInput = true;
 }
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 private void AcceptTextInput()
 {
     Hide();
     if (acceptedText != null)
     {
         if (IsKeyCodeReturn(acceptKey))
         {
             textField.text = textField.text.Replace("\n", "");
         }
         if (textField != null)
         {
             acceptedText(textField.text);
         }
         acceptedText = null;
     }
 }
Пример #12
0
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null)
     {
         label.text = labelText;
     }
     if (uiInput != null)
     {
         uiInput.defaultText    = text;
         uiInput.characterLimit = maxLength;
         uiInput.value          = text;
         uiInput.isSelected     = true;
     }
     this.acceptedText = acceptedText;
     Show();
 }
Пример #13
0
 /// <summary>
 /// Sets up the text input controls.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null)
     {
         label.text = labelText;
     }
     if (textField != null)
     {
         textField.text      = text;
         textField.maxLength = maxLength;
         textField.TakeFocus();
         ignoreFirstAccept = (acceptKey != KeyCode.None) && Input.GetKeyDown(acceptKey);
         ignoreFirstCancel = (cancelKey != KeyCode.None) && Input.GetKeyDown(cancelKey);
     }
     this.acceptedText = acceptedText;
     Show();
 }
Пример #14
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 private void AcceptTextInput()
 {
     Hide();
     if (acceptedText != null) {
         if (textField != null) acceptedText(textField.text);
         acceptedText = null;
     }
 }
Пример #15
0
		/// <summary>
		/// Accepts the text input and calls the accept handler delegate.
		/// </summary>
		public void AcceptTextInput() {
			if (acceptedText != null) {
				if (uiInput != null) acceptedText(uiInput.value);
				acceptedText = null;
			}
			Hide();
		}
Пример #16
0
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null) label.text = labelText;
     if (textField != null) {
         textField.text = text;
         textField.characterLimit = maxLength;
         textField.keyboardType = TouchScreenKeyboardType.EmailAddress;
     }
     this.acceptedText = acceptedText;
     Show();
     isAwaitingInput = true;
     textFieldLabel = labelText;
 }
Пример #17
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     //Prevent the keyboard from dismissing
     //if(EventSystem.current.alreadySelecting == true) return;
     isAwaitingInput = false;
     Debug.Log ("AcceptTextInput fired!");
     //if(Input.GetButtonDown("Submit")){
         Debug.Log ("Submit fired!");
         if (acceptedText != null) {
             //Debug.Log ("TextField");
             //Debug.Log (textFieldLabel);
             //Debug.Log (textField.text);
             if (textField != null) {
                 //Set the lua text field variables
                 //Debug.Log ("Set the lua variable!");
                 acceptedText(textField.text);
             }
             acceptedText = null;
         }
         Hide();
         onAccept.Invoke();
     //}
 }
Пример #18
0
 /// <summary>
 /// Sets up the text input controls.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null) label.text = labelText;
     if (textField != null) {
         textField.text = text;
         textField.maxLength = maxLength;
         textField.TakeFocus();
         ignoreFirstAccept = (acceptKey != KeyCode.None) && Input.GetKeyDown(acceptKey);
         ignoreFirstCancel = (cancelKey != KeyCode.None) && Input.GetKeyDown(cancelKey);
     }
     this.acceptedText = acceptedText;
     Show();
 }