Search Unity

Accessing Open Script and Goto Line fom Error in Unity Editor.

Discussion in 'Editor & General Support' started by Fehr, Feb 25, 2012.

  1. Fehr

    Fehr

    Joined:
    Mar 3, 2011
    Posts:
    23
    Hey All. I have a question I suspect it will take a Unity Dev to answer, but you've to to start somewhere so I thought I'd post here.

    I'm looking to write a plugin for Sublime Text 2, that will add support for the goto line feature. The program currently opens the correct script, and has well documented scripting language support with which go to line can be called from script. I'd also like to explore the possibility of writing an application that opens scripts/goes to line on network computers when an error is clicked.

    My problem is, how do I access this document/line number information in unity? I assume this information is sent to the program defined in Preferences > External Script Editor, but is there documentation regarding how to receive and handle this information?

    I know this is a tricky one, but it'd be great to get some direction as to where I should start.

    Thanks in advance to anyone who can put me on the right path!
     
  2. kablammyman

    kablammyman

    Joined:
    Nov 22, 2010
    Posts:
    507
    google Anomalous Underdog's tool:

    UnityExternalScriptEditorHelper-1.0.7z

    (I went to his blog, but i couldn't find any download links, otherwise i woulda gave you the link.)

    it can do what you want for any text editor out there by faking mono develop. if you still want to code it yourself, the readme for that tool says


    Unity (as of version 3.4) unfortunately doesn't pass the line number to other script editors except whichever is designated as the built-in editor (which is MonoDevelop as of Unity version 3.4).


    so...yeah...
     
  3. Fehr

    Fehr

    Joined:
    Mar 3, 2011
    Posts:
    23
    Brilliant!

    This is looks like its exactly what I was after. For anyone who may be interested in the link you can find the aforementioned tool here. Thanks kabalammyman! You've really helped out, there should be plenty of good karma coming your way for this one :).

    I'll post back to say how successful I was in getting this integrated into Sublime. If this doesn't work out, I haven't given up hope on the possibility of writing something myself, as I know that Visual Studio Pro and Unitron both support the feature and aren't 'built-in' like MonoDevelop is.
     
  4. Fehr

    Fehr

    Joined:
    Mar 3, 2011
    Posts:
    23
    This worked a treat. Download and follow the instructions. Had it wokring in Minutes. Thanks again Kablammyman for the solution Anomalous Underdog for the awesome little program, its exactly what I wanted to write, only now I wont have to!
     
  5. kablammyman

    kablammyman

    Joined:
    Nov 22, 2010
    Posts:
    507
    I'm glad it worked out for you.