As we are aiming to use it with Visual Studio Code, you can un-check MonoDevelop from the list of add-ons. Now you can go to the Unity settings and change your 'External Script Editor' to Visual Studio Code. Install.NET SKD # Command Line Interface for the.NET.
- Installing Visual Studio w/ Unity on Mac. Posted by 5 days ago. Installing Visual Studio w/ Unity on Mac. So I was installing Unity for the first time on my apple laptop, and while installing, it asks me if I want to download Visual Studio with Unity. I personally really dislike Visual Studio so I'll be using.
- The version of Visual Studio for Mac included with the Unity installation may not be the latest. It is recommended to check for updates to ensure you have access to the latest tools and features. Updating Visual Studio for Mac; Manual installation. If you already have Unity 5.6.1 or above, but don't have Visual Studio for Mac, you can install.
This section covers issues specific to a setup where you have Unity running on a Mac and Visual Studio running under Windows in a VMWare Fusion or Parallels virtual machine.
For general information on working with Visual Studio and Unity, see: Setting up Visual Studio for Unity
|
Setting up the Environment
Basic VMWare (or Parallels) and Visual Studio installation
Set up a VMWare Image with Windows XP and Visual Studio 2005 or 2008 (any edition from Express to Team System should do fine). Office for mac university 2011 download. You can probably also use Windows Vista or Windows 2003 Server. You can find the Express Edition for free at: www.microsoft.com/express/vcsharp/
This article assumes that you are already familiar with Visual Studio. If not, it's probably a good idea to do some Visual Studio tutorials first, before continuing (they should be available in the Visual Studio documentation).
I'm using VMWare, but others are using Parallels, so that should also work just fine.
Mapping the Unity Project to be Accessible from Windows
If you haven't done so already, set up your Unity projects in a folder that is accessible to your Windows XP VMWare Installation. Personally, I'm using Documents/Games in my home-folder and have mapped my home-folder to drive I: on Windows XP via a network share. Under Games/projectname I have my projects. So I can access my Unity projects on Windows XP via I:/Documents/Games/projectname.
The Reference to UnityEngine.dll and UnityEditor.dll
New approach
Assuming that you have a network drive mapped to your Applications folder (on the Mac) to drive letter F:, you can create to reference paths in the project properties:
F:UnityUnity.appContentsFrameworksManaged -> this will give you UnityEditor.dll and UnityEngine.dllF:UnityUnity.appContentsFrameworksMonolibmonounity -> this will give you the proper Mono-DLLs that Unity also uses (starting with Unity 3.0 ;-) )
Without those references, Unity won't find Boo.Lang, UnityEditor, UnityEngine and UnityScript (which are project references created by syncing the solution).
Old approach
Copy UnityEngine.dll and UnityEditor.dll to your Games-folder. To do that, open the console on Mac OS, and do something like (depending on your folder-structure):
(or, just locate Unity in your Applications folder, right-click: 'show contents', then browse to Frameworks, and copy UnityEngine.dll and UnityEditor.dll wherever you like.)
NOTE: Synching the solution will remove the references to those DLLs. So after each sync, you'll have to re-add those DLLs. Obviously, this only is a problem on the Mac.
Documentation for UnityEngine.dll and UnityEditor.dll
Wanna have this?
Just drop these two files in the same folder where you put the DLLs (Unity 2.1 version).
Note: After Unity 2.6 and the built-in Visual Studio integration, you'll want to drop the files in your 'UnityEditorDatalib' folder. If you had an existing Visual Studio project, you will need to drop and re-add the UnityEditor.dll and UnityEngine.dll references (from the lib folder just listed) before the documentation will show up.
Note: In Unity 2.6, you need to make a copy of 'UnityEngine.xml' and name it 'UnityEngine-Debug.xml'. Place in same folder.
You'll get inline documentation for all documented classes, methods and enumerations, both for UnityEngine and UnityEditor namespaces.
For some methods you'll even have parameter documentation. Basically, the newer the method, the more likely it is to have parameter docs.. UT really is doing their homework so don't hesitate to nag them (by filing 'documentation' bug reports) to keep improving the docs, they are a huge asset to the strength of Unity!
Creating a Local Project for Visual Studio
Create a project on your local C:
drive (to avoid security exceptions you may not wish to use a network drive).
In that project, create a folder lib
and put the UnityEngine.dll
into that folder. Add this as a reference.
Right-click 'References' in the project explorer, select 'Add reference', 'Browse', browse to where you put the DLLs, add them (you can select both at once). XML documentation will automatically follow. For later projects you can use the 'Recent' tab instead.
Tips
- Always leave the DLLs + XML docs in the same folder, this way when a new Unity release comes up, all you'll have to do is overwrite them and all your projects will stay up to date. If you don't want that, create a folder for each DLL version, or even create project-specific copies.
- At this point, it might be a good idea to export your project to a template, so for later projects you can directly create a Unity project with everything referenced. I would post my own template but I doubt it would cross over to a different machine.
I'm using a Windows application so I could do basic debugging by creating some buttons to start actions (thanks to Lka for a tip how to do this, see: http://forum.unity3d.com/viewtopic.php?t=7062#50779 ).
Folder Setup in Unity Project
In your Unity project, create your own Asset folder if you don't have it, yet (I'm using Working Assets
). Under that folder create a folder specifically for your C#-Unity-Scripts (I call it Scripts). Add a C# script there in Unity.
In your VS.NET 2005 or 2008 project, add a folder Projects/projectname
. Select folder projectname and use Tools / Add Directory Content (this is what you downloaded and installed the plugin for in step 2).
Add-On for Convenient Adding of Unity Scripts Note
The section below is marked as obsolete claiming that the plugin is not needed because Unity now provides a mechanism for directly creating Visual Studio solutions from within Unity. However, this is only true of the Windows version. As these are instructions for making this work with the Mac version of Unity, that note is incorrect.
Also the latest version of Windows Studio may be higher than 9.0. In fact, as of this edit, it is 10.0.
This plug-in works as advertised with Visual Studio 2010 (with the appropriate edit to the .AddIn file)
Obsolete: Add-On for Convenient Adding of Unity Scripts
NOTE: As Unity now supports directly creating the solution from within Unity, this Add-On is obsolete.
Download and installthis very practical addon
What you can use this for is conveniently add all scripts from a folder in one single 'go'.
Note: When you want to use this under Visual Studio 2008, you have to make sure that in your 'My Documents' (or 'Eigene Dateien') folder, in the 'Visual Studio 2008' folder, there's an 'Addins' folder that contains the two files AddDirectoryContent.AddIn and AddDirectoryContent.dll. In AddDirectoryContent.AddIn, make sure that 8.0 is set to 9.0:
Thanks to benblo for this tip, see also:http://forum.unity3d.com/viewtopic.php?t=7062#50996
According to psynopticM, this may not work under Visual Studio 2008 Express:http://forum.unity3d.com/viewtopic.php?p=74325#74288
End of obsolete text.
Congratulations – now you can code C# for Unity in VS.NET 2005 / 2008. With Intellisense.. and inline docs!
Visual Studio Code is a great code editor and fully compatible with Unity. If you don't know it and you want to start working with it; this little tutorial is for you 🙂
2.1 Why Visual Studio Code?
Due to the Unity's announcement in which talks about 'MonoDevelop' will no longer be the default code editor for the next releases of Unity game engine (see https://blogs.unity3d.com/en/2018/01/ 05 / discontinuing-support-for-monodevelop-unity-starting-in-unity-2018-1 /); those who still use this editor need to move to another software. In this way, Unity gives the users the opportunity to choose among code editors such as Visual Studio (in its Community or Code versions) or JetBrains.
We prefer Visual Studio Code, which is a free, powerful and easy to use code editor developed by Microsoft.
2.2 Installing Visual Studio Code.
Installing Visual Studio Code is a very simple task, you just have to do:
- Visit the Visual Studio Code website ( https://code.visualstudio.com/Download ).
- Choose your Operative System and download the Installer.
3. Open the Installer and follow its instructions (is not necessary to modify something, the default settings are suitable to have a functional Visual Studio Code in our computers).
¡Visual Studio Code is Now Installed!
Unity Mac Visual Studio
2.3 Installing C# in VS Code.
To start coding in C# (C Sharp) language and be able to work with Unity, we need to:
- Install 'Microsoft .Net Core SDK' in our computers; visit the following link to obtain the installer: https://www.microsoft.com/net/learn/get-started/windows.
- Open the 'Microsoft .Net Core SDK' installer and follow its steps to complete the installation (is a very simple process).
3. Restart your computer, then Microsoft .Net Core SDK will be ready.
With 'Visual Studio Code' and 'Microsoft .Net Core SDK' installed in your computer, the next step is getting the 'C#' extension for Visual Studio Code. There are two methods to do this:
- The first way is through the Visual Studio's 'Marketplace' website (https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp). By clicking on the 'Install' button the system will start 'Visual Studio Code' in our computers in order to continue with the installation.
- The second way is by opening 'Visual Studio Code' in our computers, then click on the 'Extensions' icon (or from the Menu bar: View → Extensions). Once the 'Extensions' window is shown, type in the search bar 'C#' and then choose: 'C#C# for Visual Studio Code (powered by OmniSharp)'.
On both ways Visual Studio Code must be open and we have to see something similar to the above picture (Visual Studio Code showing the 'C#' Extension), now just click on the 'Install' button.
¡We can Start Coding in C#!, we just need to enable Visual Studio Code within Unity.
Unity Visual Studio Code
2.4 Enabling Visual Studio Code in Unity.
Enabling Visual Studio Code as the default Code Editor inside Unity is very easy, just follow the next steps:
- Open a Unity Project (new or existing).
- From the Menu bar go to Edit → Preferences, this opens the 'Unity Preferences' window.
3. In 'Unity Preferences', at the leftcolumn click on 'External Tools', this window now will show the 'External Tools' information and here we have to select 'Browse' from the 'External Script Editor' drop-down list .
4. We have to search for the code editor '.exe' (for Windows) or '.app' (for macOS) file. For Visual Studio Code on Windows, the required file is 'Code.exe' and can be found at 'C:Program FilesMicrosoft VS Code' (or C:Program Files (x86)Microsoft VS Code). On macOS, the file is 'Code.app' and can be found at '/Applications'. Finally, this 'Unity Preferences' section will be shown like this:
¡Now We Can Use Unity with Visual Studio Code!
This Tutorial about how to install Visual Studio Code and how to enable it inside Unity ends here. Follow us in the next tutorials to learn more about the amazing Game Development World.
If you want to know more about Visual Studio Code for Unity, visit https://code.visualstudio.com/docs/other/unity or, do not hesitate to contact us for any questions or advice by clicking 'Here'