- Unity Certified Programmer:Exam Guide
- Philip Walker
- 1171字
- 2021-06-18 18:30:07
Collaborate
Collaborate is a form of version control, which means multiple people can work on the same project at the same time. It's similar to Git, Perforce, and Mercurial. All project files are stored locally but can then be pushed to an online server (the cloud) where all members of the project can pull your changes to their local machine and vice versa.
Similar to other types of version control, Collaborate has the following features:
- Add: Include your local files to the project to be pushed onto the cloud.
- Conflict Resolution: Change or update yours or someone else's scene file or code when work is merged together.
- History: Go back to a previous push to amend an issue.
- Publish: Push your work onto the cloud for everyone in the project to share.
- Pull: Pull work from the cloud to your local machine.
Collaborate also has a repository, whichis where your project is stored.
Let's move on and set up a Collaborate project in Unity.
Setting up Collaborate
To set up Collaborate for our project, follow these steps:
- Make sure you have signed in to your Unity account, as mentioned previously.
- Open the Services tab. You can do this by clicking on Windows and then Services, or you can click on the cloud in the top-right corner of the editor:

- Click on the Create button.
- With the Services tab open, change theCollaborate option to ON:
- Notice how at the top of the Unity editor, the Collab tab has a green circle with a white tick:

- Click on it and it will let you know whether you are up to date and whether there are any files that need publishing. It also tells you whether anyone on your project has published anything.
- Next, save your scene. Name it testLevel.
- Notice how your saved scene has a blue square with a plus sign. This indicates that you have a file that you can publish to the cloud:

- The Collab tab at the top has also changed from a green circle with a white tick to a blue square with a white arrow pointing upward. This means you have a new file that can be pushed to the cloud. As with any version control software, multiple files can be published in one go; you don't need to push each file individually.
- Click on the Collab tab.
- Click in the Describe your changes box here and as it prompts, provide a description. Then, click Publish now!, as in the following screenshot:

- The file will push to the cloud and your Collab tab will go back to the green circle with a white tick.
Congratulations, you have created and pushed your first change to Collaborate. This is the most common use of making a change—giving it a name and clicking Publish Now! to save your changes. Let's continue with the other features of Collaborate. Next, we will look at files that aren't of concern to us and can be left out of the project.
Ignoring files and folders
Collaborate creates a file that contains a list of file types and folders that you are likely not going to want to push to the cloud. For example, an Editor folder containing files specifically for your editor might not need to be shared with other members of the project:
- The ignore file is located outside of the Assets folder. It's default name will be .collabignore.
- Locate it and open it in a text editor to view the files and folders it's currently ignoring.
- If you wish to add more file types to ignore, you can, but I wouldn't recommend doing so unless you are sure you don't want to update specific file types.
- Close the text editor.
Let's keep going and look at what to do when we make a mistake and we need to revert the changes. We all do this!
Reverting changes
Imagine if we made a mistake in a project—for example, we deleted the testLevel.unity file and pushed it on to the cloud. This can be amended by doing the following:
- Go to the Services tab (the cloud button in the top-right corner of the editor).
- Select Collaborate.
- Under CollabHistory, click on Open the history panel.
- You will be presented with your pushes with the description you named when it was done and how many files were pushed. Also, a drop-down symbol will show the filenames that were pushed:

- Click the Restore button to bring back testLevel.unity. Any changes that haven't been published will be removed.
Now that you know how to revert your mistakes, let's now go in a little deeper and check our account to find out further information about our project with the Unity dashboard.
The dashboard
With your Unity account, you have access to more information about your Collaborate account and other services, such as Cloud Build. In a potential exam question, you may be asked what and where the dashboard is and where you would find details about your Collaborate projects. Here is how you access the dashboard:
- Click on the Go to Dashboard link in the top-right corner of the Services window:

- Within the Unity Dashboard browser, you will be presented with a series of options and details specifically to do with Collaborate, Analytics, remote settings (in Chapter 11, Storing Data and Audio Mixer, we discuss storing/manipulating online data), cloud building (briefly mentioned in the following information box), and more:

The preceding screenshot shows the Settings tab is open and Users (on the left-hand side of the screen) is where team members can be added/removed and given certain levels of access relating to the project. We don't need to go into any further detail about this, but you just need to be aware of where these extra editions are based.
Build your pushed projects online for multiple platforms (for example, Android, iOS, PC, and so on). This saves you and others in your team the hassle of switching platforms, building on a local machine, and waiting until you can start using your Unity project again. If developers in the same team are all building slightly different versions of the same build, this can be inefficient and cause issues. With Cloud Build, you are given a build number, which helps you keep tabs on the current version build.
Wow, we have covered a lot and it's only chapter 1! You have covered some of the most important stuff that isn't common knowledge when it comes to being a Unity developer. When I started as a developer, I thought it was justabout getting cubes moving and jumping and firing other cubes then prettying them up. In some ways, it is, but we need to make sure we avoid a lack of structure in Unity projects as things can fall apart quickly without it, especially when it comes to expanding a project. We will dig deeper into all of the things we have mentioned in this chapter, but for now, let's just recap what we have covered.
- Instant Node Package Manager
- Visual FoxPro程序設計教程
- Python數據可視化之Matplotlib與Pyecharts實戰
- C語言程序設計
- 碼上行動:用ChatGPT學會Python編程
- C# 8.0核心技術指南(原書第8版)
- PHP+Ajax+jQuery網站開發項目式教程
- OpenResty完全開發指南:構建百萬級別并發的Web應用
- Unity 3D腳本編程:使用C#語言開發跨平臺游戲
- Learning Node.js for .NET Developers
- Web App Testing Using Knockout.JS
- Go語言從入門到精通
- Flask Web開發:基于Python的Web應用開發實戰(第2版)
- Java程序設計實用教程(第2版)
- Qt 5.12實戰