Unity3D game development: Starting from Unity3D project version control, unity3d Game Development

Source: Internet
Author: User
Tags git commands

Unity3D game development: Starting from Unity3D project version control, unity3d Game Development

Dear friends, welcome to my blog, I am Qin Yuanpei, my independent blog address is http://qinyuanpei.com, CSDN blog address is http://blog.csdn.net/qinyuanpei. Today, I want to talk about Version Control of The Unity3D game project.

1. Why version control?

When I write code by myself, the version control concept does not exist in my mind, because I have several treasures on the code of the entire project. However, when I write code with a group of people, I may not know who modified the code in the team, even the name of a variable or a function, without my knowledge, this change may make the program unable to run. In this case, I need version control. Although Unity3D is a game engine suitable for small teams, however, even smaller teams have different division of labor. When you need to merge your work into a complete project, I need version control; when I need to understand the actual programming capabilities of team members, the best way is to involve them in the development of a project, in this way, I can learn about his working ability from the Code submitted by him. In this case, I need version control. When I want to back up the project all the time, when a project is restored to a correct state at a critical moment, copying and pasting won't make the job easy. In this case, I need version control.

2. How do I implement Version Control in Unity3D?

Zookeeper Version Control in Unity3D mainly targets the Assets and ProjectSetting folders, because other files and folders are temporary files generated by Unity3D during running, these files will be regenerated after you open the project using Unity3D, so you do not need to perform version control on these files or folders. After learning about the main content of Unity3D version control, let's focus on how to make the Version Control Software differentiate the content we submit, we know that a core task of version control is to compare files on the server with local files to find out which files are newly generated and which files have been modified. Therefore, to make it easier for the version control software to compare files, it is often necessary to convert these factors of Project changes into text forms. If you are familiar with Github, you should know that, the differences between the two files in Github are compared based on the text (CODE). Therefore, we also need to follow this principle when using Version Control in Unity3D, fortunately, Unity3D has taken this into account when managing Unity3D projects. When we perform Version Control on Unity3D projects, we need to do the following:

  • Open the Editor Settings option through the Edit-> Project Settings-> Editor menu, and set the Mode Under the Version Control option to Visual Meta Files, in this way, Unity3D will generate a corresponding file or folder for each file in the project. meta File. This file is a text file that records the relevant information of the corresponding file. The version control software can compare and merge the file versions.

  • Resources in Unity3D are organized in binary format by default, which is not suitable for version control, therefore, you need to open the Editor setting option through the Edit-> Project Settings-> Editor menu and set the Mode under Asset Serialization to Force Text.

  • Find the Revision Control Diff/Merge option through Edit-> Prefences-> External Tools. After installing the version Control software, you can find related options here. Take the blogger as an example, the blogger uses TortoiseSVN, and the options here are TortoiseMegre. Currently, Unity3D supports SourceGear DiffMerge, TKDiff, P4Megre, TortoiseMegre, WinMegre, and PlasticSCM Megre.

After completing the above preparations, we can start Version Control for the Unity3D project, currently, in Unity3D, we mainly use the following three methods to control the version of the Unity3D project:

2.1 use Asset Server for Version Control

Zookeeper Unity3D's Asset Server is a version control software integrated within Unity3D. It is similar to SVN, and is suitable for version control within a small team. It is a paid software, although it is more convenient than SVN in some aspects, it is still less used in actual projects. If you are interested in this, we can understand the specific situation from here. Here we do not intend to introduce the use of this software.

Unity3D game production (4) -- Asset Server Construction

[Tutorial] Asset Server (Joint Development)

2.2 use Github for Version Control

When zookeeper uses Github for version control, you can add one in the Git repository. the gitignore file is used to filter the files to be synchronized in the project. At the beginning of this article, we know that the version control of the Unity3D project mainly targets Assets and ProjectSetting files. you can enter the content of gitignore as follows:

Library/Temp/*.sln*.csproj*.sln*.userprefs*.unityproj*.DS_Store

Zookeeper so that Github will ignore the changes to these files each time you submit them. For details about how to use Github and related commands, refer to the following:

Summarize your common Git commands

Git Remote Operation Details

Zookeeper Github has a capacity limit of 1 GB for each repository, which is suitable for version control of small projects. SVN should be used for version control of large projects.

2.3 use SVN for Version Control

When using SVN for version control, Zookeeper can add some files and folders to the ignored file list through the right-click menu, so that SVN will ignore the changes to these files each time it submits files. This part is actually the same as Github's. gitignore. Common Software combinations of SVN are TortoiseSVN (client) + VisualSVN Server (Server). For details, refer to the two articles: SVN usage tutorial summary and client TortoiseSVN installation and usage

3. Summary

Zookeeper no matter what version control software is used, it is necessary to establish relevant code submission specifications and Process Control Specifications, therefore, one person in the team should be responsible for reviewing and standardizing the Code submitted by the team members, which can reduce various problems caused by code submission. Now, this article is written here first. I hope you will like it!

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. Reprinted, please indicate the author and source of this Article. Thank you!

Related Article

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.