[#UNITY3D] HowTo: Use TFS to manage a Unity3D project files

Hello!

For sure in English is not as good as in Spanish, but let’s start with something like “the devil is wise because he is old, not because he is the devil” (since I’m still in the phase of learning a bit of Unity3D) And when I start doing POCs I have to rely on Visual Studio, TFS and Git to have a follow-up of my changes and my progress. And as I said at the beginning, the correct phrase should be “After all the problems the devil already have, he knows is better to use TFSVC or GIT“.

Team Foundation Source Control

So I’m going to comment on the way in which I´m working (for now) with Unity3D and GIT / TFSC projects. In the first example I’m going to show the work with a classic workspace of TFS with Visual Studio Online. In the configuration of my WS have mapped the local directory “E:\srcBruno\Tests” as the root for the TP.

image

Now as far as understand, a Unity3D project is a collection of files in folders, when we created the same we do this in a location below our Workspace. In this case, it is in the location of the Workspace and with the name Uni04

image

In this case also to have a couple of files C# I added a package that brings a complete example for use with Kinect SDK V1.8 (I recommend take a look here). Once the project is created, you will see several files C#, for example in the Assets/KinectScripts folder.

image

This point is important. The first time that we open a file C# to edit it with Visual Studio, the Unity IDE will create a solution with the name of the project and the suffix “-csharp”. In our case is “Uni04-csharp“.

image

From here, the road is that we already know, right click on the solution and “Add solution to source control”.

image

Important:It must be borne in mind that by default only VS solution adds the files needed for a solution. Net. If you want to also store .meta files in TFS or with another extension, you must add them by hand.

GIT

The case of GIT is similar and is tied to the way of working of Visual Studio with GIT. As before, we create a project

image

And we open it with Visual Studio, to have a VS solution.

image

When you select the option “Add solution to source control” will see that we have the possibility of choosing between TFVC and GIT. For this case we select GIT

image

And in a few seconds we have a local repo to test with GIT

image

And this are the simple with the setup of the solution, then problems are (as always) with files that manages Unity3D. Being mostly binary and as there is no way do a merge or having an incremental history of a binary file, then changes are generated by each version and it can be a mess. I for now I do not care, I reached with having the status of the project to the X day at the time and.

By the way remember before starting to work with a file manager, you must have defined a strategy of branching and merging; not to have defined this is… die!

Greetings @ Home

El Bruno

imageimageimageGoogle

1 comment

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.