P4U has been tested with Unity Pro 3.3.0, 3.4.2f3, 3.5.0f1 and Perforce server 9.2 – 11.1. We cannot guarantee compatibility on other versions of Unity3D or Perforce.
Please refer to Perforce’s install and admin documentation for full docs
Quick install OSX:
Scripts and docs credit: http://www.piap.com/faq/p4_setup.html
create a user named admin in System Preferences: Accounts
download p4d from perforce
make a folder in the users folder (admin) named perforceServer
create the following folders within perforceServer
Copy the downloaded p4d into bin
Download the p4d scripts Perforce OSX launch scripts and unzip them into the scripts folder.
Edit p4d.sh edit the line “-p 192.168.1.9:1666 \” to match the IP of your server and change the default port of 1666.
if you have a Perforce license file copy it into “p4droot”.
You can set the “Start P4 Server” script to run at login on your server or set it in cron.
Also you can use the “Create P4 Checkpoint to create your perforce backups and journals and attach it to a cron every day.
We suggest using Cronnix to modify your cron settings. Match the following picture to set perforce server to create a checkpoint at midnight every weekday.
After installing and starting P4D (Server) test your connection
download p4 and copy it to a local directory
open a terminal or cmd browse to the folder containing the downloaded p4
type: ./p4 -p [server ip]:[server port] info
If connected properly you should get the following
Make sure only one person can check out binary files
+l: Exclusive open (locking). If set, only one user at a time will be able to open a file for editing. Useful for binary file types, which cannot be merged.
Unity requires local files to be writeable
+w: File is always writable in workspace. (Perforce manages the write bit, and files that are not checked out are, by default, not writable.)
type the following into command line:
p4 -P [password] -u [user] -p [server ip]:[server port] typemap
This will open a text file that looks like the following:
add the following under TypeMap:
Save and quit text editor. The terminal will now show typemaps updated.
Open Unity3D 3.3.0
Create a new unity project at the same directory as your P4 client root named Unity.
Open Editor Settings
Enable Version Control Support
Setting Up P4 client
This step is required to not sync or submit the temp folder and most of the library folder. The only files we sync from the library are the project config files. All databases are recreated using metadata files locally for each client.
Open P4V on your local computer and create a new workspace for the computer.
Edit your workspace view to match the following
Replace “[Depot]” with the name of your depot.
Replace “[Client Workspace]” with the name of your workspace.
//[Depot]/… //[Client Workspace]/…
-//[Depot]/Unity/Library/… //[Client Workspace]/Unity/Library/…
//[Depot]/Unity/Library/EditorBuildSettings.asset… //[Client Workspace]/Unity/Library/EditorBuildSettings.asset…
//[Depot]/Unity/Library/InputManager.asset… //[Client Workspace]/Unity/Library/InputManager.asset…
//[Depot]/Unity/Library/ProjectSettings.asset… //[Client Workspace]/Unity/Library/ProjectSettings.asset…
//[Depot]/Unity/Library/QualitySettings.asset… //[Client Workspace]/Unity/Library/QualitySettings.asset…
//[Depot]/Unity/Library/TagManager.asset… //[Client Workspace]/Unity/Library/TagManager.asset…
//[Depot]/Unity/Library/TimeManager.asset… //[Client Workspace]/Unity/Library/TimeManager.asset…
//[Depot]/Unity/Library/AudioManager.asset… //[Client Workspace]/Unity/Library/AudioManager.asset…
//[Depot]/Unity/Library/DynamicsManager.asset… //[Client Workspace]/Unity/Library/DynamicsManager.asset…
//[Depot]/Unity/Library/NetworkManager.asset… //[Client Workspace]/Unity/Library/NetworkManager.asset…
-//[Depot]/Unity/Temp/… //[Client Workspace]/Unity/Temp/…
Click apply and close the window.
Select Menu: Connection: Edit Current Workspace.
Click Advanced Tab and enable File Options: “Clobber: overwrite writeable workspace files when getting revisions”
Select the Unity folder in workspace view and mark for Add
Submit your files by right clicking on your changelist and selecting Submit.
add a description and click submit
Open Unity3D and select your recently created project
Import the P4U Package
Accept the install into your project by clicking the Import button.
Open P4U Settings window
P4U will use your Perforce environment settings if you have set them. You can also manually set them for each Unity3D project which is the preferred method when working with multiple projects and perforce depots.
Server IP and Port: Enter the IP address and port of your perforce server. ex. 192.168.1.200:1666
User Name: Enter your perforce user (Owner) name
Client Workspace: Enter your perforce workspace name
Click Save Settings
P4U consists of two main windows the Project View and The Submission window.
The Project Window allows you to see the Perforce status of all files in your unity project. It also provides a menu bar with buttons to Sync to Latest, Submit, Checkout Selected, Revert Selected and Revert All.
contextual menus, right mouse click or [Ctrl] left mouse click on mac, allow you to sync, checkout, revert, mark for delete and submit individual files.
When you select submit from the menu bar, P4U menu or contextual menu a new submission window appears. This window allows you to select which files to submit and provide a perforce changelist description.