getting intellisense while writing C# unity scripts

hello all,

any idea on how to get intellisense and syntax checking while writing C# unity scripts, most probably in an external editor such as Mono Develop or Visual Studio.Net if not possible inside unity.

thanx.

Some people are using X-develop for this.

http://www.omnicore.com:80/en/xdevelop.htm

It runs on OS X and you can supposedly point it to the Unity engine .dll (found inside the /Applications/Unity/Unity.app/Contents/build/UnityEngine.dll, possible others for completeness) and your project .dll’s (found inside your PROJECT FOLDER/Library/ScriptAssemblies/*.dll).

I am 99% sure you can set it up in VS.net too using the .dll that David mentions, but I can’t help you find out how.

-Jeremy

I use Visual Studio for Unity C# coding with full auto-complete/intellisense (.NET classes, Unity classes, and my own classes). It’s super-handy.

Create a new C# project and do Project->Add Reference, then Browse tab and point it to a copy of the UnityEngine.dll file. That’s pretty much it.

There are some fancy things you can do with symlinks to avoid having all of the .csproj/.sln/.suo files ending up in your Unity assets folder, but it isn’t a requirement of the setup. I also created some Visual Studio templates for my own boiler-plate class, a singleton/manager class, and others. The great thing about the VS templates is it sets the class name/filename and everything for you too.

I would actually code in JavaScript if there was an editor available with autocomplete for built-in/custom classes. I’d rather use a more verbose language with the crutch than a simpler language without. If only Unity had an editor comparable to http://www.flashdevelop.org/ for Actionscript (a great open-source standalone editor with full class completion)…

thanx a lot guys for the very useful and time saving info.

are you alternating between windows and os x as you develop under VS and Unity constantly transferring files.

I run them side by side. Easiest to just show rather than type up a long explanation:

interesting, really interesting. but where are your project files residing, on which machine, the windows or the os x machine?

The project files are all on the Mac (I use Windows sharing on the Mac, and mount my home directory as a drive letter on the Windows box).

I use xdevelop (on the mac of course). Works great. Offers better code completion than any other IDE (or text editor) that I’ve tried… and I’ve tried them all.

Although if I could use Visual Studio on my mac I would. …theres another reason to get a new MacBook!

…I set a project reference to UnityEngine.DLL, but I don’t set references to the script assemblies. Instead I just have the xdevelop project saved in my Unity’s “workingassets” folder and have all my C# script files in the xdevelop project… and then I simply use xdevelop as a text editor (I don’t use it to compile anything).

I want…I want…

so is X-develop worth it’s 499 USD asking price? Just curious.

cheers.

Yeah, I do the same. I edit code with VS, and network save the files on my mac. All you have to do is hit command r on the mac to reload. Works really well.

Thanks for the how-to on adding the reference.

-Jeremy

Is it that expensive? I bought version 1.2 about a year ago for something like $150 (they had some special going). I find the intellisense feature to be almost invaluable… however $500 is probably too much considering that most of its features aren’t going to be used when only using it for Unity.

Omnicore should come out with a stripped down “lite” version made specifically for Unity.