I’ve finally updated the TextMate Unity JavaScript bundle to support Unity 2.1.
Please back up the old one before installing this one, just in case! Also note to do a clean install of this bundle first remove the old one from /Users/yourName/Library/Application Support/TextMate/Bundles/ as TextMate seems to append when updating bundles… a bit annoying.
I’ve also added the first revision of code completion to the bundle. Start typing a word and hit Option+Escape and a list of functions/classes/enumerations will pop up. Unfortunately this is as close as it gets to auto code completion in TextMate 1.57. So hopefully when 2 is released they’ll have some kick arse approach!
It’s still a bit of a work in progress. I still need to add more function information to each function/class so you can then use “Documentation for Function Call (tool tip)”, Control-Option-Escape to get some info to help remember what properties that function is expecting.
I’ve also added a documentation link to Microsoft’s online API for looking up those useful .NET/Mono functions.
I’ve also cleaned up the syntax sets so that they work with the default TextMate syntax colours. Sorry to those who’ve already setup a nice colour set based of the old bundle.
[EDITED] Added support for Unity iPhone and for these helpful 3rd party utilities: AniMate and SpriteManager.
I just converted the Unity parts of Emanuel’s C# bundle to work with JavaScript. I also added a snippet for Debug.Log (log). Find the bundle here. Please let me know if anything needs fixing.
Ok, that sort of whet my appetite for snippet making, so I’ve added macros for Update(), FixedUpdate(), Start(), typed variables, RequireComponent and AddComponentMenu. It’s available at the original location.
Bundle is Corrupt
The bundle Unity JavaScript.tmbundle does not contain the required info.plist file (or that file is corrupt) and can therefore not be installed.
[Continue]
ref=${TM_SELECTED_TEXT}
UNITYDOC="/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/$ref.html"
if [[ -f "$UNITYDOC" ]]
then [[ -n "$UNITYDOC" ]] exit_show_html "<meta http-equiv='Refresh' content='0;URL=tm-file://$UNITYDOC'>"
else echo "No Unity documentation found for: $TM_SELECTED_TEXT"
fi
It’s better in two ways: it uses the local docs, and it goes directly to the documentation rather than doing a search. Although maybe it should do a search if it can’t find the actual file. I’ll look into that.
Yes I know about the local documentation. The reason I changed it on my machine is because it didn’t always work reliably. So I changed it to the web version.
One of the best features is the project wide find replace. It rocks. You cna also work within a project and outside a project at the same time, so you can for instance have the same car.js script open from 2 unity projects and clearly see and tell which is which.