Launching local Unity API Reference from MonoDevelop

Latest version of MonoDevelop that comes with Unity 3 has the neat shortcut ' which takes you to the Unity API Scripting Reference. However, while it sometimes opens the local documentation as I want it to, sometimes it will open the documentation at unity3d.com. How can I make it consistently open the local documentation?

hmm..i also want to know how to do? i use ctrl+' to take the Unity API Scripting Reference will very slow.. :(

For any Unity type selected in your
code, you can press CMD+’ to jump to
Unity’s manual page on that type in
your browser. No more googling “Unity
GameObject”!

For more TIPS and TRICKS on Mono + Unity3d, take a look at this cheatsheet for shortcut and it’s blog for detailed explanation on Tips and Tricks. Worth the reading.

http://philippseifried.com/blog/2012/08/07/monodevelop-cheatsheet/

http://philippseifried.com/blog/2012/08/06/unity3d-monodevelop-tips-and-tricks/

CHEATSHEET PDF :

http://www.philippseifried.com/blog/files/misc/Unity-MonoDevelop-Cheatsheet.pdf

You can use Redirector (Firefox, Chrome or Opera) to redirect to your local documentation. Install the addon, and open the options. (Ctrl+Shift+A > Extensions > Redirector > Options)

Then use these values (or similar, depending on the location of your local documentation):

  • Description: Unity Documentation (or whatever you’d like)
  • Example URL: http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=Transform (Or any other search query. Used to preview what the link will redirect to. This is optional.)
  • Include Pattern: http://unity3d.com/support/documentation/ScriptReference/* Note that I use unity3d.com/support/documentation/ScriptReference/..., because that is the URL opened by MonoDevelop, which is then redirected to docs.unity3d.com/ScriptReference/...
  • Redirect To: file:///C:/Program Files (x86)/Unity/Editor/Data/Documentation/html/en/ScriptReference/$1 If Unity is not installed on the C drive or if you use a different OS, you’re gonna have to find out what the local URL looks like, and replace everything to the right of /ScriptReference/ with $1. (/ScriptReference/index.html to /ScriptReference/$1)
  • Pattern Type: Wildcard
  • You can leave all other fields as they are.

Now anytime you press the shortcut, you will automatically be redirected to your local API reference instead of the online one. I’ve also tested it without internet connection. Unfortunately, the addon is only available for Mozilla Firefox, and I haven’t succeeded in doing that with other tools for different browsers yet.

Unity’s Mono AddIn searches at fixed paths for local documentation and uses the online one, if it cannot be found there. The standard installation uses slightly different paths. To fix this you can create the following symbolic links.

For Mac, as admin, create:

for name in $(ls /Applications/Unity/Documentation/en/); do ln -s  /Applications/Unity/Documentation/en/$name/   /Applications/Unity/Documentation/$name; done

On Windows, as admin, use:

mkdir "c:\Program Files\Unity\Editor\Data\Documentation\Documentation"
mklink /D "c:\Program Files\Unity\Editor\Data\Documentation\Documentation\ScriptReference" "c:\Program Files\Unity\Editor\Data\Documentation\en\ScriptReference\"
...

Hint to Unity: Great tool! Easiest solution would be adjusting the lookup paths in the AddIn accordingly. As far as I can tell, this affects lines 56-60 in UnityUtilities/Commands.cs. Also, if no direct hit was found and it switches to search, it will always go to the online version, which would not be necessary. This affects parts that have no topic of their own or if a type or method name is only partially selected.

MonoDevelop will use the local documentation when it finds an exact match. When it has to perform a search, the web api is used instead.

I followed @Martin Bernemann’s solution, and found it really works, but there is still some problem. The 30_search.html opened is plain text without css style and js scripts. So I made several links of other folders under the same “c:/program files/unity/editor/data/documentation/en” folder.

mklink /D "c:\Program Files\Unity\Editor\Data\Documentation\Documentation\ScriptReference" "c:\Program Files\Unity\Editor\Data\Documentation\en\ScriptReference\"

mklink /D "c:\Program Files\Unity\Editor\Data\Documentation\Documentation\Manual" "c:\Program Files\Unity\Editor\Data\Documentation\en\Manual\"

mklink /D "c:\Program Files\Unity\Editor\Data\Documentation\Documentation\StaticFiles" "c:\Program Files\Unity\Editor\Data\Documentation\en\StaticFiles\"

mklink /D "c:\Program Files\Unity\Editor\Data\Documentation\Documentation\StaticFilesManual" "c:\Program Files\Unity\Editor\Data\Documentation\en\StaticFilesManual\"

mklink /D "c:\Program Files\Unity\Editor\Data\Documentation\Documentation\uploads" "c:\Program Files\Unity\Editor\Data\Documentation\en\uploads\"

I am new to unity. Short cut ctrl + ’ does not work for me. what have i missed.