17 Mar, 2009
Message Window in Unity
Remember the message window that Director has? Very useful if you just want to quickly try out something. Do it while your game is running or not running, it’s all good.
It’s one of the few Director features that I’ve missed in Unity for a while. When Miguel de Icaza announced an interactive c# program, I was very excited, as this opened the door to a message window in Unity.
I’m not completely done yet, but check out this preview of an in-unity c# “message window”.
(not embedding as the swf has huge dimensions)
http://lucasmeijer.com/files/messagewindow.swf
A few notes:
- This works at runtime, in your webplayer too. (at a hefty 3mb pricetag)
- This should work in Unity 2.1 as well.
- Careful readers will note the usage of the ‘var’ keyword, which is not supported by the version of Mono that Unity embeds. This is because this tool embeds its own c# compiler, and I chose to use a much more recent version of the mono c# compiler than what Unity ships with. Don’t look at this video and think Unity2.5 will ship with an upgraded Mono.
- Still have lots of stuff to add. Tab completion, Intellisense, shift-return executing multiple lines, being able to drag gameobjects in, and have them be replaced by GameObject.Find(”thename”);
- Miguel+friends did all the real work, I just put a few pieces together.
All in all, it’s great fun to work on some tech purely for fun again.
I’ll probably release this as an open source package when it doesn’t require tiptoeing around all its infancy problems. Maybe I’ll talk the unity guys into including it in the next version.
I think this shows again what great move it was for Unity to embed Mono. Mono rocks.

