Visual Studio 2015 Online with Unity3D

Orignal Source : https://yecatsgamedev.tumblr.com/vs15Unity 
Configure Visual Studio 2015 Community Edition and Visual Studio Online for Unity 
Configure Visual Studio 2015 Community Edition and Visual Studio Online for Unity 
This tutorial will walk you through enabling the Visual Studio suite to work with Unity. At the end you will have the following accomplished: 
  1. Visual Studio will be the primary IDE for Unity. 
  1. Your Unity projects will be stored in your private Visual Studio Online repository. 
For those of you not familiar, Visual Studio Online a collaboration tool provided by Microsoft and is free for up to 5 users. Perhaps one of the most important features that it has when it comes to game development is the private source control support. (Meaning, you have a private repo for free!) The nice thing about Visual Studio Online is that it comes with a lot of really awesome features on top of the source control support. Some of my favorite one’s are the work item tracking and agile planning tools. 
Prepare Your Environment 
Setting up Visual Studio to work with Unity is very easy to do.  
  1. Download and Install Unity. 
  1. Download and Install Visual Studio 2015. 
  1. Download and Install the Visual Studio 2015 Preview tools for Unity. 
  1. Create a Visual Studio Online account. Make a note of the the URL that you select for your account as you will need it later. 
Note: Visit http://unityvs.com/ for the latest toolset. 
Getting Visual Studio and Unity to Play Together 
The latest version of Unity defaults to Visual Studio as your IDE, but if you do not have the UnityVS asset in your project, you will run into an error. Fortunately, fixing this is very easy.  
Do the following inside of Unity: 
  1. Select Assets –> Import Package –> Visual Studio 2015 Tools, or 
  1. Select Assets –> Import Package –> Navigate to: C:\Program Files (x86)\Microsoft Visual Studio Tools for Unity\2015\Visual Studio 2015 Tools.unitypackage. (This is the default install path. If you changed it you will need to navigate to your custom location.) 
  1. The Importing Package window will open up. Ensure that all items are selected and click Import. 
Image 
Setup Your Project to Check In to Visual Studio Online (VSO) 
Create a Visual Studio Online Project 
The first thing that you will need to do is create a new VSO project for your game:  
  1. Login to your VSO project by navigating to the URL that you choose before. (It will be in the format of: https://{youraccount}.visualstudio.com/. 
  1. Select New under Recent projects & teams Image 
  1. A Create New Team Project dialog window will appear.  
  1. Fill out the Project Name and Description fields as you see fit. 
  1. Optional: I recommend changing Process Template to Agile, however you can keep it at Scrum if you prefer that methodology. This comes into play if you decide to use work item tracking as it will alter the work item types. See this article for more information on the difference. 
  1. Version Control should be set to Team Foundation Version Control.Image 
  1. Select Create Project 
  1. It will take VSO a few minutes to finalize creating your new project. Once it is complete select Navigate to project. 
Take a look at the “How to” videos on your projects home page for more information on using the various VSO features as this tutorial will only go over checking in your code.  
Configure Your Unity Game 
If you are familiar with using git or TFS then you will be used to the idea of storing every single artifact of your project within your repository. With Unity you will only need to store the text metadata about the artifacts. Unity is smart enough to utilize that metadata in order to determine what the artifact originally was. The nice thing about this is that you are only storing a subset of the original game data in your repository, which saves quite a bit on space.  
Take these steps to configure Unity: 
  1. Load your project. 
  1. Select Edit –> Project Settings –> Editor. The settings will appear in the Inspector Tab. 
  1. Under Version Control, set the Mode to Visible Meta Files. 
  1. Under Asset Serialization, set the Mode to Force Text. 
Image 
Connect to your VSO Account in Visual Studio 
  1. Open your game in Visual Studio by either double clicking an existing script or selecting Visual Studio Tools –> Open in Visual Studio menu option. 
  1. Inside of Visual Studio, select Team –> Manage Connections menu options. The Team Explorer panel will open. 
  1. Select Manage Connections –> Connect to a Team Project. Image 
  1. The Connect to Team Foundation Server window will appear.  
  1. Select Servers… 
  1. Select Add… 
  1. The Add/Remove Team Foundation Sever window will appear.  
  1. In the Name or URL of Team Foundation Server text field, enter the URL of your Visual Studio Online account. (https://{youraccount}.visualstudio.com/). All other fields will turn gray.  
  1. Select Okay.Image 
  1. You should be prompted to enter your VSO credentials. 
  1. You will be taken back to the Connect to Team Foundation Server window, but now you will have a list of Team Projects on the right side. 
  1. Select the checkbox next to your project.  
  1. Select Connect. 
  1. The Team Explorer tab should take you to the Home menu of your project. If it did not, you can double click the name of your project that is or click the Home icon at the top of the pane.  
Image 
Link Your Unity Project Files to Your VSO Project 
The final step is to map your game files to your Visual Studio project.  
IMPORTANT: I highly recommend making a back up of your game before proceeding with this step. If you try to remove your mapping before checking in, Visual Studio will delete all of the files in the folder.  
  1. On the Home screen of the Team Explorer window, Select Source Control Explorer. 
  1. Under your VSO account on the left, right click on your project and select Advanced –> Map to Local Folder.Image 
  1. The Map window will appear. 
  1. Click the three dots (…) next to the Local Folder input and navigate to the root of your Unity project. (Do not navigate into the assets folder.) Visual Studio may add an extra folder to the end of your local folder. Remove it so that you are pointing towards the root.Image 
  1. Select Map. 
  1. Visual Studio will ask you if you want to execute a get. Select Yes. (There’s nothing to get, so this doesn’t matter.) 
  1. Under your VSO account on the left, right click on your project and select Add Items to Folder… Image 
  1. Select the Assets and Project Settings folders. 
  1. Select Finish. 
  1. Your new folders should now be visible In the right pane of the Source Control Explorer with a + sign next to them. The + sign means that it is a new addition to your VSO project that has not been checked in.  
  1. Image 
  1. On the Team Explorer tab, select Pending Changes.Image 
  1. Under the Comment input, enter “First Check in”. (I recommend always entering comments as there will be times when you want to remember what you did!) 
  1. The Included Changes section should be populated with a list of the files that you added in steps 8 and 9.  
  1. Select Check In. 
  1. You will receive a confirmation prompt, select Yes. 
Note: Steps 7-15 will need to be repeated throughout your development cycle, particularly as you add new assets to your game. The nice thing is that Visual Studio will only show you artifacts that are not already checked in when you click the Add Items to Folder.. button, so the process is very quick.  

Comments