UnityEngine.TextEditor.MoveLineStart C# (CSharp) Method

MoveLineStart() public method

public MoveLineStart ( ) : void
return void
        public void MoveLineStart()
        {
            int num3;
            int num2 = (this.selectIndex >= this.cursorIndex) ? this.cursorIndex : this.selectIndex;
            while (num2-- != 0)
            {
                if (this.text[num2] == '\n')
                {
                    num3 = num2 + 1;
                    this.cursorIndex = num3;
                    this.selectIndex = num3;
                    return;
                }
            }
            num3 = 0;
            this.cursorIndex = num3;
            this.selectIndex = num3;
        }

Usage Example

コード例 #1
0
ファイル: Indentation.cs プロジェクト: eledezma/CodeEscape
    //Switches the GUI on and off
    //*******************************************************
    void Update()
    {
        if (atWall)
        {
            if (Input.GetKeyDown("e"))
            {
                //			Screen.lockCursor = false;  //Cursor is free to move when user goes into terminal
                if (guiEnabled)
                {
                    resume();
                }
                else
                {
					StartCoroutine(jackin ());
                }
            }
        }
        else
        {
            //Screen.showCursor = false;
            //Screen.lockCursor = true;  //Hiding Cursor means redoing the way the crosshair was implemented -Josephs
            //Screen.lockCursor = false; //Cursor remains locked if not in terminal
        }
        editor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl);
        editor.MoveLineStart();
    }
All Usage Examples Of UnityEngine.TextEditor::MoveLineStart