Manage Unity projects with SVN

Source: Internet
Author: User



our projects are using SVN management, these days encountered a few problems, resolved a bit, by the way a summary.

1 . Some settings and instructions for using SVN to manage Unity Projects

First inUnityperform two operations in:Edit->projectsettings->editormenu, selectverion Control Modeto beVisivalemeta File, selectAsset Serialization Modeto beForcetext. First step Select external version control visibleMetafile, this will look like aAssetfolder below each resource creates a. Metatext files, to recordUnityimportant information that is needed. It is important where you will see it later. The second step is becauseUnityMost of the files are binary stored, often resulting in inexplicable conflicts, which can bring huge amounts of data, cannot be merged, and a benefit inBlamethe time is clear and intuitive. and canMergeThe convenience of the scene is not measurable. The second 3rd of the article is described in detail around this two setting.

Let's talk now . SVN the creation of the directory. the new Unity Project General directory under Window is as follows:

There are only two folders that we need to care about:Assetsand theprojectsetting. The former does not say much, the latter preserves somesettingfiletag LayerphysicsIt is also necessary to wait. andLibraryjust a cache of imported resources, there are statements on the Internet to keep a variety ofManagerfiles and the like, actually not necessary. It's all that's left.MonoorVSTo produce without concern.

so a formal project is generally a good local need SVN Save the two folders and upload them to SVN server so that you can ensure that you do not affect your work Unity Minimum amount of project preservation.

2 . Two issues: Default script loss and file movement

      This is often the case in front of me: I'm doing aPrefab, includingGameobjectand hanging on top of the script that uploadsPrefaband theCSfiles toSVN, but others Pullafter the project, I found you .Prefabthe script ismissing, this is a huge headache, re-drag the workload is enormous, and re-set the script parameters is also a very troublesome thing. The reason for this problem is that this is what we mentioned earlier.Metafile. MetaThere's an important thing in the file.GUID,GUIDis the file's only indication, and the relationships in the file are based onGUIDInstead of based on file name and path. When a new file is created,Unityit will automatically generate aGUID. If not uploadedMeta, so two works ofGUID, the association relationship is naturally not found. So we also have to put the correspondingMetafile Upload. Of course, if you are willing to parseMetafile, and then modify it directlyGUIDis the better way, of course, the relative is also prone to error.

Similarly, when you move or rename a resource, make sure that you also move or rename it accordinglyMetafile. When the contents of the script file change, the actualGUIDis not going to change. andUnityIn fact, it is not based on the change in file content increment management, but the overlay. So the official document mentions the movement of the file is also particularly cautious, directly inUnityThe best way to do this. The special note here is thatgitand theSVNthe difference, inUnityin the new file,gitwill default to you in the local library to find out and then let you submit. andSVNNo, you need to do it manually.Add, if no display is selectedMeta, it was tragic. Here is the above mentionedverion ControlmodeSelect VisibleMetathe importance of it.

3 about the scene Merge

      we mentioned earlier that we let the resources be serializedtext. The same is true for a scene modification. AAdd a monster,Badded a tree. ACommit First,BYou must doMerge. Opening the scene will tell you there is a conflict and there is nothing in the scene. Open the text format of the scene as we previously chose to usetextTo store resources, this time the benefits are coming, the file'stextThe format should look like this:

Mine :

Middle :

Theirs :

Ok , it's obvious. Specific XXXX content is interested in the words can be seen in detail, but I think, most of the scene-based merge should only merge not modify it. So, the scene changes before or the team to negotiate, the scene of the merge trouble and do not please.

It was just used .SVNManagementUnityproject, so the previous two questions have been met by me, fortunately, the duplication of work is not very large. On the forum when you see such a phrase "use a person asSVNAdministrator. Everything is submitted through this administrator. Other people can only download(Do not submit permissions). Everything you modify is integrated with the administrator. " Actually also feel very good, especially when the project big up, involving the art planning and program interaction, this administrator is both integrated and optimized, can solve a large number of cooperation issues, the project is very good. Want to useUnityThe working team has helped.

Manage Unity projects with SVN

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.