UnityEngine.TextEditor.MoveLeft C# (CSharp) Method

MoveLeft() public method

public MoveLeft ( ) : void
return void
        public void MoveLeft()
        {
            if (this.selectIndex == this.cursorIndex)
            {
                this.cursorIndex--;
                this.selectIndex = this.cursorIndex;
            }
            else if (this.selectIndex > this.cursorIndex)
            {
                this.selectIndex = this.cursorIndex;
            }
            else
            {
                this.cursorIndex = this.selectIndex;
            }
            this.ClearCursorPos();
        }

Usage Example

コード例 #1
0
        protected void DoPageUp()
        {
            UnityEngine.TextEditor editor = GetWidgetController();

            // Seems to be no way to move more than one line at
            // a time - so have to do this:
            int pos  = Math.Min(editor.pos, contents.Length - 1);
            int rows = ((int)innerCoords.height) / FONT_HEIGHT;

            while (rows > 0 && pos >= 0)
            {
                if (contents[pos] == '\n')
                {
                    rows--;
                }
                pos--;
                editor.MoveLeft();  // there is a MoveUp but it doesn't work.
            }
        }
All Usage Examples Of UnityEngine.TextEditor::MoveLeft