TL;DR;
Debug.Log($@"<a href=""{filePath}"" line=""{line}"">link</a>");
ConsoleWindow以外で
UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal
で即時開くことができます。
Button等で蹴ってあげればいいでしょう。
また、ConsoleWindowと同じようにAタグによってリンクを張ることもできます。ただし、GUIStyleをCN Message
にしておく必要があります。
staticLazy<GUIStyle>STYLE=newLazy<GUIStyle>(()=>(GUIStyle)"CN Message");EditorGUILayout.SelectableLabel($@"<a href=""{filePath}"" line=""{line}"">link</a>",STYLE.Value);
Sample project
https://github.com/wallstudio/UnityTest_2019_4_4/blob/codelink/Assets/Editor/TestEditor.cs