UnityEngine.TextEditor.MoveRight C# (CSharp) Method

MoveRight() public method

public MoveRight ( ) : void
return void
        public void MoveRight()
        {
            this.ClearCursorPos();
            if (this.selectIndex == this.cursorIndex)
            {
                this.cursorIndex++;
                this.DetectFocusChange();
                this.selectIndex = this.cursorIndex;
            }
            else if (this.selectIndex > this.cursorIndex)
            {
                this.cursorIndex = this.selectIndex;
            }
            else
            {
                this.selectIndex = this.cursorIndex;
            }
        }

Usage Example

コード例 #1
0
        protected void DoPageDown()
        {
            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 < contents.Length)
            {
                if (contents[pos] == '\n')
                {
                    rows--;
                }
                pos++;
                editor.MoveRight(); // there is a MoveDown but it doesn't work.
            }
        }
All Usage Examples Of UnityEngine.TextEditor::MoveRight