- This is a Unity project (Unity
6000.4.0a5, seeProjectSettings/ProjectVersion.txt). - Game/project content lives in
Assets/(scenes, materials, sample content). - Custom render pipeline work lives in
Packages/:Packages/Custom_URP/: "Vivid RP", a customized fork of URP17.4.0(Runtime/,Editor/,ShaderLibrary/,Shaders/,Tests/,Samples~/,Documentation~/).Packages/CoreRP/: SRP Core17.4.0(shared rendering utilities + tests/samples).Packages/com.deltation.unity-pix/: PIX tooling integration (Editor-only).
- Unity package boundaries are defined by
*.asmdefandpackage.jsonfiles.
- Open locally: use Unity Hub and select the repo root (
D:\URP_Extension). - Dependency management: edit
Packages/manifest.jsonvia Unity Package Manager; avoid hand-editingpackages-lock.json(often regenerated). - Run tests (headless example):
"<UnityEditorPath>\\Unity.exe" -batchmode -projectPath . -runTests -testPlatform EditMode -logFile Logs/editmode.log -quit
- Run all tests:
"<UnityEditorPath>\\Unity.exe" -batchmode -projectPath . -runTests -testPlatform PlayMode -logFile Logs/playmode.log -quit
- Run specific test class:
"<UnityEditorPath>\\Unity.exe" -batchmode -projectPath . -runTests -testPlatform EditMode -filter "BuddyAllocatorTests" -logFile Logs/test.log -quit
- Run specific test method:
"<UnityEditorPath>\\Unity.exe" -batchmode -projectPath . -runTests -testPlatform EditMode -filter "BuddyAllocatorTests.Allocate1" -logFile Logs/test.log -quit
- Build players: use Unity Editor "Build Settings…", or a dedicated CI script if one is added later.
- C#: 4-space indentation, braces on new lines (Allman style), one type per file, namespaces match folder intent.
- Naming follows SRP/Unity conventions:
PascalCasetypes/methods,camelCaselocals/params,m_member fields,k_constants. - Keep code in the correct assembly folder (
Runtime/vsEditor/) and update/keep*.metafiles with any asset change. - Imports: standard
usingstatements (System namespaces first, then Unity namespaces), typically sorted alphabetically by namespace.
- Uses Unity Test Framework (
com.unity.test-framework1.6.0). - Place tests under
Packages/*/Tests/Editor(EditMode) orPackages/*/Tests/Runtime(PlayMode/Runtime). - Test class attributes:
[TestFixture]for NUnit-style tests. - Test method attributes:
[Test]for simple tests,[UnityTest]for coroutine-based tests requiring frame updates,[TestCaseSource]for parameterized tests. - Use
using varfor disposable test resources; cleanup with[TearDown]orObject.DestroyImmediatefor Unity objects. - Prefer deterministic tests; avoid GPU/driver-dependent assertions unless explicitly scoped and documented.
- Test naming:
[MethodName]_Should_[ExpectedBehavior]or descriptive action-based names (e.g.,TestMainLightRenderingLayerMaskSync...).
- Use
Debug.LogWarningfor non-critical issues (e.g., missing assets, invalid configurations). - Avoid empty catch blocks; handle or log exceptions appropriately.
- Assert preconditions and invariants for critical rendering paths.
- No automated linting/formatter configured; follow Unity SRP codebase conventions manually.
- Use XML documentation comments (
/// <summary>) for public APIs, types, and complex methods. - Inline comments for non-obvious implementation details or workarounds.
- TODO comments are acceptable for tracking known issues or future improvements; mark with
TODO:prefix.
- Commit messages commonly use a lightweight Conventional Commits style (examples from history:
feat: ...,refactor: ...). - PRs should include: purpose, affected package path(s) (e.g.,
Packages/Custom_URP/...), reproduction steps, and before/after screenshots for rendering changes. - Keep diffs focused; Unity can reserialize assets—avoid unrelated scene/material churn when possible.