# 6. Worked Example — Day-One UVCS on a Unity 6 Project Part of [[UVCS]]. Previous: [[5. Desktop Client and Inviting Teammates]]. Next: [[7. Pitfalls and When to Stay on Git]]. **Goal:** In one sitting, put a **throwaway** Unity 6000.5+ project under UVCS, check in a clean tree, lock a binary, and prove a second machine / teammate can update. > [!note] Verification status > This lab sequence follows Unity's published how-to + Hub/UVCS docs. It was **not** executed against Marshall's live Unity org for this write-up. ## 6.0 Lab prep 1. Create a new **3D (URP)** or empty project named `UvcsLab` via Hub — Unity **6000.5+**. 2. **Edit > Project Settings > Editor** - Asset Serialization: **Force Text** - Version Control Mode: leave compatible with UVCS once connected; keep **Visible Meta Files** mindset from [[1. Serialization Meta and Gitignore]] 3. Import or create one intentional binary, e.g. `Assets/_Lab/Art/Prop.fbx` (any small FBX). 4. Confirm `ProjectSettings/ProjectVersion.txt` exists (Hub identity file). Optional Editor sanity menu from [[1. Dashboard Org and Editor Connect]]: ```csharp #if UNITY_EDITOR using System.IO; using UnityEditor; using UnityEngine; public static class UvcsLabReadyMenu { [MenuItem("Tools/UVCS Lab/Print ProjectVersion")] static void Print() { var path = Path.GetFullPath(Path.Combine(Application.dataPath, "..", "ProjectSettings", "ProjectVersion.txt")); Debug.Log(File.Exists(path) ? File.ReadAllText(path) : "MISSING ProjectVersion.txt"); } } #endif ``` > [!warning] Code not compiled in Unity > Not compiled/tested in Editor for this note. ## 6.1 Connect **Path A — Hub (existing project)** 1. Quit the Editor. 2. Hub → `UvcsLab` contextual menu → **Use Unity Version Control** → **Connect to Version Control**. 3. Reopen the project; open **Window > Unity Version Control** if needed. **Path B — Editor toolbar** 1. Version Control icon → log in with Unity ID → create/select organization → **Create workspace**. Choose a **Plastic** workspace for this lab (branch tooling later). Name repo `UvcsLab` (or accept suggestion). ## 6.2 ignore.conf before the giant checkin 1. In Pending changes, ensure `Library`, `Temp`, `Logs`, `UserSettings`, `Obj` are **not** selected for checkin. 2. Prefer establishing `ignore.conf` early (desktop client **Add to ignored list**, or paste Unity's recommended template from [[3. Checkin Pending Changes and ignore.conf]]). 3. Decide: check `ignore.conf` **in** so the teammate inherits it on update. ## 6.3 First checkin 1. Pending changes → select `Assets/`, `ProjectSettings/`, `Packages/`, and your shared `ignore.conf` if versioned. 2. Comment: `Initial UVCS checkin — UvcsLab URP template + Prop.fbx` 3. **Checkin changes**. 4. Changesets tab → confirm changeset exists. ## 6.4 Smart Lock the FBX 1. In Workspace Explorer / Editor pending UI, locate `Assets/_Lab/Art/Prop.fbx`. 2. **Lock and checkout** (or Checkout if a rule already applies). 3. If prompted, create a **repository lock rule** for `*.fbx` (or the specific path). 4. Modify something trivial (reimport settings, or touch a material reference) → checkin. 5. Confirm lock releases on destination `/main` (or becomes Retained if you intentionally used another branch — prefer `/main` for the lab). See [[4. Branches Smart Locks Exclusive Checkout]]. ## 6.5 Invite and second seat 1. Version Control tab → Options → **Invite Members to Workspace**. 2. Add the teammate (or your second Unity ID) in the Dashboard; grant a role that can update + checkin. 3. On the second machine: Hub **Add from repository** (or desktop client workspace + **Add project from disk**). 4. Open project → update to latest changeset → confirm `Prop.fbx` present. 5. Attempt checkout while the first seat still holds a lock (optional negative test) → expect lock dialog. ## 6.6 Optional branch drill (Plastic) 1. Create branch `/main/fix-prop-tweak` from latest `/main`. 2. Switch workspace to that branch; edit a **text** asset (a small `.cs` or ScriptableObject YAML). 3. Checkin on the branch. 4. Merge back to `/main` in desktop client; resolve with UnityYAMLMerge if a scene was involved ([[3. UnityYAMLMerge Smart Merge]]). ## 6.7 Lab exit criteria - [ ] Org + repo + workspace exist - [ ] `Library` never appeared in a Changeset - [ ] First Changeset includes Assets + ProjectSettings - [ ] FBX lock rule demonstrated - [ ] Second seat updated successfully - [ ] Students can explain Plastic vs Gluon in one sentence ([[2. Create Workspace Plastic vs Gluon]]) ## Next [[7. Pitfalls and When to Stay on Git]] — when to abort UVCS and remain on GitHub.