Version: 2019.4
Интеграция с Perforce
Using external version control systems with Unity

Plastic SCM Integration

Plastic SCM is version control software. For more information on Plastic SCM, see their website.

To set up Plastic SCM, see their documentation on setting up Plastic SCM. For information on setting up version control in Unity, see the documentation on version control.

Checking files out with Plastic SCM

Plastic SCM automatically checks files out if you have modified them. The only files that require specific checking out instructions are Project Settings files, otherwise you can’t change them.

Resolving conflicts and merging with Plastic SCM

You’ll need to perform a merge when you edit something in your Project locally which has also been edited remotely (a conflict). This means you need to review the changes before you can perform the merge. If Unity recognises that you need to perform a merge before you submit changes then it will prompt you to complete the merge. This will take you to the Plastic SCM client.

If incoming changes conflict with local changes then a question mark icon appears on the conflicting files in the incoming changes window. Here is a quick guide to resolving conflicts and merging with Plastic SCM:

  • In the Version Control window select the Apply all incoming changes button. This automatically takes you to the Plastic SCM GUI client.
  • In the client window, click Explain merge for a more visual understanding of the changes. Select Process all merges and another window displays.
  • This window shows the individual conflicts, and you can choose what changes you want to keep or discard.
  • Once you have resolved the conflicts, select save and exit, and Plastic SCM will complete the merge operation.
  • Push the changes through Unity’s Version Control window.

Locking Files with Plastic SCM

To lock files with Plastic SCM, perform the following actions:

  • Create a lock.conf file and place it in your server directory. You can find your server directory in ../PlasticSCM/server.
  • In the lock.conf file, specify the repository you are working on and the server to complete the lock checks. Here is an example:
rep:default lockserver:localhost:8087
*.unity
*.unity.meta

В таком случае все .unity и .unity.meta файлы будут заблокированы для контроля в ‘default’ хранилище.

  • Restart the server by opening a terminal/command line window and locating the server directory. Once in the directory you can restart the server with the command ./plasticsd restart.
  • Open the Unity Editor and check out a file that you expect to be locked, then go back to the terminal/command line and type: cm listlocks
  • The terminal/command line window displays a list of locked files. You can also test if this has worked by trying to check out the same file using a different user. An error will appear in Unity’s console saying the file is already checked out by another user.

Для дополнительной информации можете посетить раздел документации посвящённую Plastic SCM lock файлам.

Differences from Perforce

PlasticSCM does not support remote activity, like Perforce does. As such, this functionality is unavailable for Plastic SCM in the Editor. Statuses such as: “Checked out Remote” or “Out of Sync” aren’t displayed in the Project Window.

Distributed and offline work with Plastic SCM

For more information about working in distributed mode (DVCS) and offline with Plastic SCM see Plastic SCM’s Distributed Version Control Guide.

Интеграция с Perforce
Using external version control systems with Unity
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961