UnityEngine.TextEditor.MoveTextEnd C# (CSharp) Method

MoveTextEnd() public method

public MoveTextEnd ( ) : void
return void
        public void MoveTextEnd()
        {
            int length = this.text.Length;
            this.cursorIndex = length;
            this.selectIndex = length;
        }

Usage Example

コード例 #1
0
ファイル: UIInput.cs プロジェクト: Henry-T/UnityPG
	/// <summary>
	/// Notification of the input field gaining selection.
	/// </summary>

	protected void OnSelectEvent ()
	{
		selection = this;

		if (mDoInit) Init();

		if (label != null && NGUITools.GetActive(this))
		{
			label.color = activeTextColor;
#if MOBILE
			if (Application.platform == RuntimePlatform.IPhonePlayer ||
				Application.platform == RuntimePlatform.Android
#if UNITY_WP8
				|| Application.platform == RuntimePlatform.WP8Player
#endif
#if UNITY_BLACKBERRY
				|| Application.platform == RuntimePlatform.BB10Player
#endif
			)
			{
				mKeyboard = (inputType == InputType.Password) ?
					TouchScreenKeyboard.Open(mValue, TouchScreenKeyboardType.Default, false, false, true) :
					TouchScreenKeyboard.Open(mValue, (TouchScreenKeyboardType)((int)keyboardType), inputType == InputType.AutoCorrect, label.multiLine);
			}
			else
#endif
			{
				Input.imeCompositionMode = IMECompositionMode.On;
				Input.compositionCursorPos = (UICamera.current != null && UICamera.current.cachedCamera != null) ?
					UICamera.current.cachedCamera.WorldToScreenPoint(label.worldCorners[0]) :
					label.worldCorners[0];
#if !MOBILE
				mEditor = new TextEditor();
				mEditor.content = new GUIContent(mValue);
				mEditor.OnFocus();
				mEditor.MoveTextEnd();
#endif
				mDrawStart = 0;
				mDrawEnd = 0;
			}
			UpdateLabel();
		}
	}
All Usage Examples Of UnityEngine.TextEditor::MoveTextEnd