Hello,
I am making a custom script template. I want this template to be in menu Assets/Create/CustomTemplate.
I created corresponding menu item, and I want to open my previously saved text file (Editor\Data\Resources\ScriptTemplates\CustomTemplate.cs) in default script editor.
My question is - is there any way that i can get default script editor via script and give it a path of a file to open?
I am aware that this can be done via System.Diagnostics.Process.Start(), but this will open hardcoded application, not the default script editor.
I’ve searched alot, and the only things I’ve found is
UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal();
and
AssetDatabase.OpenAsset();
I think the first one pretty close, but I don’t know how I get correct name of the script