- Home /
API help in Visual Studio?
Anybody know how to get the help of the Unity API in the Visual Studio IDE? Thanks.
Answer by Vurawid · Sep 30, 2015 at 03:33 AM
I realize this is an old question, but wanted to add some additional information for those that might benefit.
For those that don't have it, install Visual Studio. It's now free for many users.
Make sure Visual Studio Tools for Unity is installed and the configuration is done.
As djradon mentioned, the standard shortcut is CTRL+ALT+M,CTRL+H for Unity Documentation Access
If you want a simpler shortcut or even to make it the same as in MonoDevelop, you can do the following...
Open Visual Studio
Go to: Debug > Options and Settings > Environment > Keyboard
Find command "Help.UnityAPIReference"
Assign a new shortcut.
For example: CTRL+ALT+'
In MonoDevelop, the shortcuts are CTRL+' (Windows) or CMD+' (Mac)
Adding a Button to The Toolbar: With the tighter integration with Visual Studio mentioned in the Unity 5.2 release notes, it's fairly simple to add a button to the toolbar instead of using the shortcut keys. This may be possible in other versions, but I only decided to do this recently...
Go to menu: View > Toolbars > Customize
Click New
Enter a name such as “API Reference”
Click OK
Go to Commands tab
Select Toolbar
Choose the new toolbar name in the dropdown
Click Add Command
Select the Help category
Choose cmdIdUnityDocumentation
Click OK
There should now be a Unity API Reference button on the toolbar
Please see RedElijah's comment if you would also like to change the API Reference to open in an external browser instead of inside a Visual Studio tab.
Searching Offline Docs: By request, the below instructions provide a way to more easily search offline documentation. This uses external tools. Other options would be to build an add-in for Visual Studio (or MonoDevelop) or ask Unity to update the existing add-in.
Open Visual Studio
Go to the menu: Tools > External Tools
Click the Add button
Make note of how many external tools there are now (it will be needed later).
Enter a Title:
Unity API Offline SearchEnter path to your desired browser as Command:
C:\Program Files (x86)\Mozilla Firefox\firefox.exeEnter the URL below as Arguments:
"file:///C:/Program Files/Unity/Editor/Data/Documentation/en/ScriptReference/30_search.html?q=$(CurText)”Leave empty: Initial Directory
Leave unchecked: Prompt for arguments
Click OK to save changes.
Replace "#" in the below two items with the number of external tools noted earlier.
To add to toolbar as a button... follow steps earlier above on how to add the API reference button, but instead of the command "cmdIdUnityDocumentation" choose "External Command #” under the Tools category.
To add a keyboard shortcut… go to Tools > Options > Environment: Keyboard and look for the command "Tools.ExternalCommand#”.
How To Use It?
Select the text you want to search then run the external tool with preferred method (toolbar button, shortcut key, or menu option).
Warning: The external tool runs as a command line argument. Avoid selecting quotes in search text as it will cause undesired behavior.
How To Setup In MonoDevelop?
It is in a slightly different menu location (mentioned below), but very similar to Visual Studio setup. I was unable to bind a key or create a button so you will need to run it from the menu option created.
Go to the menu: Tools > Options > Environment: External Tools
Thank you so much for taking the trouble to update this post. That's exactly what I was looking for.
Very useful, Vurawid - thank you.
I wanted to add that it's also possible to open Unity's API pages in an external browser (which will be familiar behavior if you used $$anonymous$$onoDevelop), rather than within one of Visual Studio's own tabs. This is particularly useful if you appreciate having a separate window or use a multi-monitor setup.
To do this, go to TOOLS > OPTIONS > TOOLS FOR UNITY > GENERAL > DOCU$$anonymous$$ENTATION > USE EXTERNAL BROWSER (set to TRUE).
Thankyou so much!!! I've gone all day learning and watching the tutorial videos and I couldn't figure this out. Thank you!!!!
Answer by djradon · Dec 14, 2013 at 04:28 PM
In Visual Studio, ctrl+alt+m and then ctrl+h works for me.
This works for me too, but I was unsure if this was added by unityVS or if it came standard.
On a side note, I find it easier to switch to a browser than to use a 3-key then 2-key keyboard sequence.
Just added this to my custom toolbar (to avoid the odd "shortcut" or switching to browser). Thanks for the answer - it was bugging me that I couldn't get contextual help from within VS.
Hi ! This shortcut is added by Visual Studio Tools for Unity, so don't forget to install it first :-)
Answer by CHPedersen · Jul 05, 2011 at 06:10 AM
I'm not totally sure what you mean by "get the help of the Unity API", so I'm going to take a best guess here. ;) Do you mean how to get Intellisense (Autocompletion) to expose the variables, properties, classes and methods available when you include the Unity namespaces? (UnityEngine, UnityEditor, etc)
If so, then the answer is that you need to set up Visual Studio as the IDE for Unity. You do this in Edit->Preferences->General tab->External Script Editor.
Make sure that's set to Visual Studio. Unity will now open up scripts in Visual Studio when you click on the "Edit..."-button in the inspector, and the instance of Visual Studio that opens will have references to Unity's assemblies, which is what enables the intellisense.
Answer by AlexQ · Jul 05, 2011 at 06:57 AM
No, Christian. I use Visual Studio to edit my Unity C# scripts. And I often need to look the definition of the API used in my source code from the editor of Visual Studio without switching to the web browser. Visual Studio offers the convenient functionality to look the Windows API definitions in MSDN from the editor of Visual Studio by press F1 key.
This is not possible with Unity's API. It happens with the $$anonymous$$SDN information because $$anonymous$$icrosoft has included the same snippet of text in summary-tags before all their properties, classes and methods. Unity isn't designed specifically for Visual Studio and so does not include this functionality.
Answer by TobyXD · Jan 16, 2013 at 03:30 AM
There is a iniline document at the unity wiki for MonoDevelop & Visual Studio But it seems support to unity 2.6
Your answer
Follow this Question
Related Questions
Need help using Google Drive API from NuGet with Unity 0 Answers
Multiple Cameras Access API 0 Answers
Some questions about the Tilemap API 1 Answer
[ERROR 405] Unity WebGL with 3rd part APIs 1 Answer
My apk not working properly in runtime 0 Answers