SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: sandworm on April 20, 2012, 04:59:19 pm

Title: Unity3d support
Post by: sandworm on April 20, 2012, 04:59:19 pm
Hey guys,

I'm sorry if this has been posted before, I couldn't seem to search for it. I'd like to get my Unity3D dlls imported into slickedit so I can get code completion working. Does anyone know how to do this? I was at GDC this year and I was told it was possible, and that it had been done.

Thanks!!
Duane
Title: Re: Unity3d support
Post by: Clark on April 21, 2012, 01:02:02 am
You will need to create a SlickEdit project at the root of your unity source tree.  Add you source files or wildcards to the SlickEdit project. If you add wildcards to the project when you add new source files, they will get picked up. Once your source files are added, you will get completions for known symbols. It easy to add symbols for most 3rd party libraries your code accesses. C++ run time libs can be tagged by the quick start wizard.

Configure the editor in unity to use SlickEdit.
Title: Re: Unity3d support
Post by: Clark on April 21, 2012, 01:04:38 am
If you're on Mac, you need v17 for the external editor support in unity to work. V17 is in beta.
Title: Re: Unity3d support
Post by: sandworm on April 21, 2012, 03:41:10 pm
Thanks Clark. I got the project set up, but I still can't read the Unity symbols. I have the Unity DLLs which contain the information I need. In VS, I can just choose "Add Reference" and select the DLL. What steps do I need to take to do this in SlickEdit? It seems the terminology is different.

Duane
Title: Re: Unity3d support
Post by: Clark on April 21, 2012, 06:15:36 pm
only symbols from .net dlls can be read. Otherwise, you need to add source files or zip files which contain source code.
Title: Re: Unity3d support
Post by: sandworm on April 21, 2012, 06:23:14 pm
I suspect these may be .net dlls, how would I try to import them?
Title: Re: Unity3d support
Post by: Clark on April 21, 2012, 06:31:55 pm
Go to (Tools>Tag Files) to manage run-time tag files.

You need to add a run-time tag file for a specific language (C#? or whatever language you want to see the symbols in). If they are .net dlls, you'll be able to add them to the tag file.
Title: Re: Unity3d support
Post by: sandworm on April 21, 2012, 06:50:30 pm
Thanks Clark. I've tried that, both with the Unity DLLs and the documentation XMLs, but I still can't seem to get it to syntax highlight or give me code completion for any of the Unity classes. What am I missing? I REALLY want to ditch Monodevelop :) If I could get SlickEdit working properly, I would be thrilled.

Duane
Title: Re: Unity3d support
Post by: Clark on April 21, 2012, 07:08:08 pm
To view what symbols are in the tag file you created, use the symbols tool window.
Title: Re: Unity3d support
Post by: sandworm on April 21, 2012, 08:44:11 pm
I appreciate your help, Clark. I just gave this a go, but it seems not to have added any symbols.
Title: Re: Unity3d support
Post by: Clark on April 21, 2012, 08:47:09 pm
Hmm...the symbols have to be somewhere. Is your app c# or something else?

What DLLs did you add?
Title: Re: Unity3d support
Post by: sandworm on April 21, 2012, 08:51:12 pm
Maybe I'm doing something incorrectly. I have attached the dll + xml to this post, perhaps you can easily see what I'm doing wrong.
Title: Re: Unity3d support
Post by: Clark on April 21, 2012, 08:58:58 pm
What lauguage are your source files written in?

What OS are you running?
Title: Re: Unity3d support
Post by: sandworm on April 21, 2012, 09:00:46 pm
To be honest, I'm not sure exactly what the source DLL is. The likeliest candidate is C++. I personally am running OSX.
Title: Re: Unity3d support
Post by: Clark on April 22, 2012, 12:33:58 am
I would like to know your source language not theirs.
Title: Re: Unity3d support
Post by: sandworm on April 22, 2012, 12:39:51 am
Ha! I am writing in C# :)
Title: Re: Unity3d support
Post by: Clark on April 22, 2012, 01:10:50 am
That helps. In order for your code to call APIs in their DLL there must be a .net-like DLL. Doesn't unity use mono for its c# implementation? If so, it uses the same .net CLI format for .DLL files.
Title: Re: Unity3d support
Post by: Clark on April 22, 2012, 12:42:24 pm
The files you sent work perfectly. The .xml file is recognized as a .net symbol file with comments. The .dll is recognized as  .net CLI DLL.

The .dll file has two namespaces (UnityEngine, UnityEngineInternal). The .xml file has two namespaces (System, UnityEngine). Tons of symbols under these.

Go to Tools>Tag Files to create a tag file with these symbols.

Press the "Add Tag File..." button to create a new tag file. Choose the language C# to add the tag file for C#. Specify an name like unity.vtg.

Use the "Add Files" button to add the files to the tag file.
In order to view your files, you will need to change the File Types in the open dialog. Just type "*.dll" or *.xml" to view one of your file types.

Once you added your files to the tag file, you can view the symbols in the Symbols tool window by expanded the tag file you created.

Just ask if you get confused creating the tag file.
Title: Re: Unity3d support
Post by: sandworm on April 22, 2012, 07:19:02 pm
That worked a treat! Thanks a million, Clark. I really appreciate your taking the time to walk me through this. I'm going to spend a few days getting used to SlickEdit, then spread the word.
Title: Re: Unity3d support
Post by: sandworm on April 22, 2012, 07:35:28 pm
Hey Clark, I started a new project in my working folder, but it doesn't seem like the tag file that we had created is being assigned to it. Do I have to associate it somehow?

EDIT: Never mind, I got it. This is awesome :)
Title: Re: Unity3d support
Post by: Clark on April 22, 2012, 09:49:04 pm
I'm going to investigate this more. We may have time to add unity to our automatic tagging.   
Title: Re: Unity3d support
Post by: sandworm on April 22, 2012, 10:00:35 pm
That would be truly epic. The unity forums are filled with people looking for an alternative to MonoDevelop on Mac. Please let me know if you end up going forward with it!
Title: Re: Unity3d support
Post by: Clark on April 22, 2012, 11:42:13 pm
I already started. I'll let you know.
Title: Re: Unity3d support
Post by: Clark on April 23, 2012, 02:32:40 pm
Unity support is done for Mac and Windows. I plan to work on Linux next. It will be in the next v17 beta.

It's very automated. When you edit a C# file and type something (like '.' or '(') which requests symbol information, it automatically builds a tag file for UnityEngine.dll and the C# framework (mono on Mac and Unix, Microsofts DLLs on Windows) if it can find installations for them.
Title: Re: Unity3d support
Post by: sandworm on April 23, 2012, 02:37:28 pm
Nice job Clark!! I can't wait to get v17!

EDIT:
I have posted a note on the Unity forum to let people know about this awesome upgrade.
http://forum.unity3d.com/threads/133323-SlickEdit?p=901264#post901264
Title: Re: Unity3d support
Post by: Clark on April 23, 2012, 03:03:01 pm
Unity isn't available for Linux. I thought it was because MonoDevelop is available.
Title: Re: Unity3d support
Post by: sandworm on April 23, 2012, 04:04:50 pm
Oh, that's not the issue at all. The problem is the MD mac port that Unity distributes. It works (kind of), but it's not native cocoa and it's just really irritating to work with. It's the Unity mac users that are going crazy for a nice IDE.
Title: Re: Unity3d support
Post by: sandworm on April 23, 2012, 10:17:55 pm
I should have let you know Clark, there is another UnityEditor dll that I didn't send over. You should probably integrate this one as well.
Title: Re: Unity3d support
Post by: Clark on April 23, 2012, 10:21:13 pm
I saw unityeditor.dll. I'll add that as well. Why doesn't unity ship the .xml files anymore?
Title: Re: Unity3d support
Post by: sandworm on April 23, 2012, 10:24:49 pm
No idea...
Title: Re: Unity3d support
Post by: Clark on April 23, 2012, 11:06:27 pm
I'm pretty sure those files are automatically generated. Can you bug them to ship the .xml files for those .dll files. It's trivial as you know for us to utilize them.

We can't ship files or data we don't own :-(
Title: Re: Unity3d support
Post by: sandworm on April 23, 2012, 11:16:49 pm
I will post it to my thread in the Unity forum, but in the meantime, are you still able to integrate Unity support in b17?
Title: Re: Unity3d support
Post by: Clark on April 23, 2012, 11:24:55 pm
Yes. I already added the second DLL. The XML files are used for comments. Not essential but helpful.
Title: Re: Unity3d support
Post by: skywise on April 29, 2012, 12:16:21 am
Let me add my thanks as well Clark, I just started messing around with Unity this last week and had started messing with the C# and using SE and Google led me right here.

Another thing you might consider is adding a ".NET" or "Mono" group to the tagging options that would auto-select .DLLs as the tagging type.  My first attempt was to try to scan .cs files which, obviously Unity doesn't have.  (Although a Unity project type on SE would be great too)
Title: Re: Unity3d support
Post by: Clark on April 29, 2012, 12:54:04 am
The support I added for unity is easier than even auto tag. Just open a c# file, start typing, and the necessary tag files will be built.

You do need to create a project in SlickEdit with wildcards to specify your source files.