Version: 2020.3
Perforce 集成
Plastic SCM plugin for Unity (beta)

Plastic SCM Integration

Use Plastic SCM version control software to enable teams to collaborate on Unity projetcs.

Learn how to set up Plastic SCM. Leanr how to set up version control in Unity.

Checking files out with Plastic SCM

Plastic SCM automatically checks files out if you have modified them. The only files that you must specificly check out to modify are Project Settings files.

Resolving conflicts and merging with Plastic SCM

When you edit something locally in your project which has also been edited remotely, a conflict occurs. If your project has conflicts, you must:

  • Review the changes
  • Merge the changes

If Unity recognises that you need to perform a merge before you submit changes then it prompts you to complete the merge. This takes 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:

  • Version Control 窗口中,选择 Apply all incoming changes 按钮。此时将自动跳转到 Plastic SCM GUI 客户端。
  • 在客户端窗口中,单击 Explain merge 以更直观的方式了解更改情况。选择 __Process all merges__,随即将显示另一个窗口。
  • 此窗口显示各个冲突,您可以选择要保留或丢弃的更改。
  • 解决冲突后,请选择保存并退出,Plastic SCM 将完成合并操作。
  • 通过 Unity 的 Version Control 窗口推送更改。

Locking Files with Plastic SCM

要使用 Plastic SCM 来锁定文件,请执行以下操作:

  • 创建一个 lock.conf 文件并将其放置在服务器目录中。可在 ../PlasticSCM/server 中找到服务器目录。
  • 在 lock.conf 文件中,指定正在处理的代码仓库以及要执行锁定检查的服务器。下面是一个示例:
rep:default lockserver:localhost:8087
*.unity
*.unity.meta

在此示例中,所有 .unity 和 .unity.meta 文件都将被锁定以便在存储库“default”上签出。

  • 打开 Unity Editor 并签出希望锁定的文件,然后返回到终端/命令行并输入:cm listlocks
  • 终端/命令行窗口会显示已锁定文件的列表。还可以通过尝试使用其他用户身份签出同一文件来测试是否可行。Unity 的控制台中将显示一条错误消息,指出该文件已被其他用户签出。

For more information on locking, see Locking: avoiding merges for unmergeable files and Configuring exclusive checkout (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

Learn more about distributed version control.

Learn more about distributed and centralized version control.

Perforce 集成
Plastic SCM plugin for Unity (beta)