public void GoToFileAndLine(string fileName, int line, int column) { UIDETextEditor te = editor.editorWindow.OpenOrFocusEditorFromFile(fileName); if (te != null) { int lineOffset = (int)((editor.actualTextAreaRect.height / editor.charSize.y) * 0.5f); te.ScrollToLine(line, lineOffset); te.cursor.posY = line; te.cursor.posX = column; } hasGotoRequest = false; }
public void GoToDeclaration(System.Object[] posObj) { if (posObj.Length != 1) { return; } if (posObj[0].GetType() != typeof(Vector2)) { return; } Vector2 pos = (Vector2)posObj[0]; int line = (int)pos.y; UIDETextEditor te = editor; if (te != null) { int lineOffset = (int)((editor.actualTextAreaRect.height / editor.charSize.y) * 0.5f); te.ScrollToLine(line, lineOffset); te.cursor.posY = line; te.cursor.posX = (int)pos.x; } }