UnityDevelop, An Editor for Unity JavaScript
Choosing a language for Unity development is a tricky thing. There are a lot of great reasons to use C# (like its tool ecosystem), but other, just-as-great reasons to use JavaScript (like its less verbose and more accessible nature). The Unity forums have endless debates about language choice.
The availability of Intellisense with Visual Studio is a huge reason to use C#. However, we liked the simplicity of Unity’s JavaScript, its similarity to Flash’s ActionScript, and some of its automagical features like compiler support for yield. Ultimately we decided to use UnityScript here at Flashbang, and modified FlashDevelop to provide an editor environment with code completion. We use FlashDevelop for our Flash work already, so this made sense.
We’ve been using this tool for over a year now, internally. It’s still a hack–so your mileage may vary–but we’ve been quite happy with it! It’s taken us awhile to scrounge together a release, but here it is:
Installing UnityDevelop
1) Get Windows. UnityDevelop is a modified FlashDevelop. Unfortunately, FlashDevelop is Windows-only, which means you’ll need to find some way to run Windows alongside your Mac (unless you’re using Unity 2.5 by now, in which case you’re probably golden)! We recommend using Synergy to share a keyboard/mouse between both monitors, or virtualizing Windows entirely.
If you virtualize Windows, seriously look into a stripped-down version of XP. You can use nLite to do this yourself, or you can download a pre-made ISO if you don’t mind dipping into the shadier areas of the Internet. This will reduce the memory footprint of XP tremendously (the popularity of Netbooks means there are endless tutorials and pre-made variants available). If you run multiple monitors, you probably don’t want to run the Coherence/Unity feature, which can be slow with a ton of desktop real estate. We run Parallels in windowed mode.
2) Download UnityDevelop (2.9 MB).
3) You probably want the classes for Unity 2.6 (replace the files in your UnityDevelop\Classes directory).
4) Unzip, and copy the UnityDevelop directory to “C:\Program Files”. There are some hard-coded paths in here; apologies if you organize your apps differently!
Creating a Project
UnityDevelop works best if you have your scripts in a single, scripts-only directory to begin with. Open up UnityDevelop, and go to Project->Create Project. We directly access our Unity project files via a network share; this is fine.
Select “Empty Project” as your template, give it a name, and browse to your scripts directory. This will look like:
A “project” is just a pointer to a directory. If you add new files in Unity, they will show up here. If not, click the refresh icon in the “Project Explorer” pane, or, in a worst-case scenario, just restart UnityDevelop. In general it’s easiest to make new files in UnityDevelop directly. The same restrictions apply here, though–make sure you do all of your script renames in Unity itself (if you rename outside of Unity it’ll look like one file was deleted and the other freshly created).
Code Editing
Now, edit away! You’ll get autocompletion for built-in Unity scripts, as well as your own files.
Hooray!
Tips, Tricks, and Questions
Changing the Font
Our default settings file uses Consolas, which is a great programming font. If you want to change the font, close UnityDevelop, edit Settings\ScintillaNET.xml, and restart.
Project-Wide Search
CTRL-I is the shortcut to find in project. It populates the search terms with your selection–you can easily select something, hit CTRL-I, enter, and see results immediately. Nice!
Goto Declaration
F4 will go to the declaration of a function. You’ll end up in the intrinsic class files for anything Unity-specific.
Editing Into Two Directories
If you get crafty with symlinks you can edit into your “Scripts” directory and the “Editor” directory. On your Mac, create an empty folder, and then create symlinks into your project folder for both. Create the UnityDevelop project file in this new directory. If none of this makes sense, don’t worry (Pro Tip: Use a network share to access your Mac; this won’t work with VMWare/Parallels built-in sharing).
I Can’t It to Work. Can You Help Me?
Honestly, no, we can’t. Sorry! It took us forever just to release this, and all we had to do was zip up some files and write this post. We don’t have time to support it, so you’re kind of on your own.
I Added Some New Stuff. Do You Guys Want It?
Yes please! It would be awesome to see this grow. Just drop us an email! FlashDevelop 3 is almost done, too, if someone wants to take a stab and making the same hacks.
Here is the source code, by the way.
Tags: JavaScript, UnityDevelop

February 4th, 2009 at 10:52 am
I looked into what it would take to get FlashDevelop on MacOS using Mono’s Windows.Forms, but the code has some 140 P/Invoke’s that call into Windows native functions.
It might be a nice task for a summer internship though.
February 5th, 2009 at 12:24 pm
hmmm… ever tried unpacking a Mac zip file on a windows machine? Pff… all directories get overwritten by 0kb files.
Any chance you could zip it on windows for easier deployment… don’t feel like handmaking all the directories an copying individual files.
Thanks!
w.
February 16th, 2009 at 7:06 pm
yeah, I second the ZIP issue. I can’t unpack it drag/drop with Windows XP’s built-in Zip support.
HOWEVER, using Windows XP’s “extract all files” option (far left) does work.
February 20th, 2009 at 12:35 am
Wow missed this, thanks!
FlashDevelop, based on SharpDevelop, is by far the best Flash / Flex /haXe IDE so it is really great to release this for Unity. I hope one day I or someone has the time to port to Mono even with the 140 pinvokes.
I have been using FD without the intellisense/autocomplete but may have gotten around to it. It looks like it was built with an older FD maybe I will look into adding a project type like haXe has done.
Thanks for putting this out there.
February 20th, 2009 at 12:53 am
nm saw that it is based on FD2, may take a look at updating for FD3 source.
February 20th, 2009 at 2:26 pm
Works great! using in VMWare with unity mode it’s not even an issue
February 20th, 2009 at 4:23 pm
Nice work! Why did you choose to re-package FlashDevelop. Did you think of releasing this as a plugin to FlashDevelop?
-Thomas
February 26th, 2009 at 1:22 pm
Thomas: We re-packaged FlashDevelop because it was a lot faster. Rather than create a proper UnityComplete plugin, I just made some quick-and-dirty changes to ASComplete. Same with core application changes–just did one-line hacks here and there rather than architect something proper.
I recently made a bridge application that can be set as the editor on Unity in OSX, and passes on the file/line# to UnityDevelop to open. I’ll get that posted soon…
April 4th, 2009 at 1:53 pm
This is pretty slick. I say we get a pool going to pay for that summer intern. I would pitch in.
April 18th, 2009 at 7:00 am
Hey guys, the Unity IRC channel told me that this was one of the better solutions for editing scripts so I’m giving it a whirl! Looks good so far! Thanks for releasing it the indie community!
April 21st, 2009 at 7:15 am
This works really well, thanks!
I was sort of bummed the unity editor didn’t tell me what I could do, and it really hampered my ability to learn by just trying stuff out. This is a great addition to that workflow.
It works perfectly on my Windows Vista Business 64, I just needed to extract to Program Files (not the x86 directory) and it runs fine.
April 23rd, 2009 at 7:34 pm
Its not a perfect solution but you can partially enable the F1 context sensitive help in UnityDevelop by going into the Tools->Program settings and change
ASCompletion.Documentation.HekpCommand to
http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=@CLASSPACKAGE+@CLASSNAME+@MEMBERNAME
I says its not perfect for 2 reasons.
1. I couldn’t get it to work using the local help that is installed by the Windows version of Unity, because it didn’t like the file:// path
2. It only seems to work on class names or datatypes and not member names (I’m not sure why that is)
But its better than nothing.
I guess if someone spent the time, they could fix the issue with it not putting the ?q etc when using file:// paths and probably work out why the help is only working on classnames etc.
May 18th, 2009 at 6:03 pm
Hi there,
Great release, i wish Unity have some kind of editor with autocompletion and intellisense. :S
Anyways, it dosent work with VMware fusion.
It gives me an error:
Its there any requirement to make UnityDevelop working fine on windows, like .net runtime framework or visual studio runtime?
Tank for the help
May 18th, 2009 at 6:04 pm
Here is the error:
The application failed to initialize properly (0xc0000135). Clickk OK to terminate the application.
May 31st, 2009 at 11:59 am
Just tried to install on a fresh XP SP2 VMWare image and I receive the same error as tatoforever above.
June 2nd, 2009 at 12:38 am
I’ve found a way to unzip the file in Windows without worrying about the pesky 0kb files for anyone interested. Using 7zip I open the zip file and deleted the _MACOSX folder and the .DS_Store file (in the Unity Develop folder) After that I could unzip it fine without any errors.
Thanks for this btw Flashbang! Very useful.
June 4th, 2009 at 4:36 am
This is the best blog so far on unity.cannot wait for the next post and what is to come. Big thanks. Even though a lot of the code is above my head because I am new, your insight into the concepts of unity game making are really helping me so much.great stuff
June 6th, 2009 at 1:11 am
Hey Scott, install .net runtime 1.1,2.0 with hotfixes.
You will not get the error anymore
But i still dont have autocompletion lol.
June 6th, 2009 at 1:47 am
Ok i got it working OMMMMMMMM ffff GOODD tanks guys!
You need two thing to get this working
.Net runtime framework, 1.1 and 2.0.
Extract UnityDevelop into PROGRAM FILES so so your desktop shortcuts points to:
“C:\Program Files\UnityDevelop\UnityDevelop.exe”
February 11th, 2010 at 12:25 pm
Wow, this is exactly what I was hoping existed and had no hope on finding it. Thank you!!
February 17th, 2010 at 5:35 pm
This is great.. the only problem is that if the UnityDevleop editor is already open and I double-click a text file in the Unity project, I get an error message dialog: “Error while opening the server”.
If I click the message dialog away, the UnityDevelop editor will open already. Is there anyway to enforce UnityDevelop to only open a single instance of the editor? (Is there a setting for this).
February 19th, 2010 at 7:20 pm
I just started playing with Unity and got recommended this UnityDevelop, which seems a great tool.
I am having a problem with UnityDevelop showing “what to do next”, like when I type “Vector2(” in UniSciTE, it says “Vector2(float x, float y)”, but this is not happening in UD.
Besides this, it’s working perfectly on Windows.
Any tips?
February 19th, 2010 at 7:27 pm
@Jeremiah
I got used to this issue. All you have to do is get used to use Unity just to quick read your scripts, while use UD for opening scripts and editing.
February 20th, 2010 at 6:52 am
regarding step 3, where did you get access to the classes for Unity 2.6?
February 22nd, 2010 at 5:08 pm
@halogenx
For UnityDevelop we just parsed the Unity Documentation and created the implicit classes from that information. You could also use Mono’s reflection to get all of the UnityEngine class information, though that doesn’t come with the nice function comments.