Unity¶
Scope: Unity projects (Unity 6 and recent LTS versions), from small games to large multi-team productions. These guidelines build on the general guidelines.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
Unity publishes thorough official guidance. Follow these as the baseline. The files below add only cross-cutting rules and decisions.
- 10 Level up your code with design patterns and SOLID (Unity e-book): SOLID and the main game programming patterns, applied in Unity C#.
- 9 Best practice guides (Unity Manual): the index of Unity's official e-books and guides, including scripting, architecture, DOTS and multiplayer.
- 9 Create modular game architecture with ScriptableObjects (Unity 6 edition) (Unity e-book): data containers, event channels, runtime sets and enums built on ScriptableObjects.
- 9 Ultimate guide to profiling Unity games (Unity e-book).
- 8 Create a C# style guide (Unity 6 edition) (Unity e-book): naming, formatting and code-organisation conventions.
- 8 Best practices for organizing your Unity project (Unity): folder structure, naming and version control.
- 8 Optimize performance for mobile, XR and web games and for consoles and PCs (Unity e-books).
- 8 Game Programming Patterns (Robert Nystrom): engine-independent, free online, and the background to many of the patterns above.
- 7 How to architect code as your project scales (Unity, 2019): avoiding technical debt as a project grows.
Guidelines in this folder¶
- Project structure: folders, assemblies, packages and version control.
- Code architecture: patterns, ScriptableObjects, dependencies, events and lifecycle.
- Content and performance: asset loading, memory, profiling and localization.
- Rendering and shaders: render pipelines, draw calls, shader variants and warm-up, textures and level of detail.
- Testing: Unity Test Framework, testable design and CI.
Sample projects¶
- 7 Boss Room: a multiplayer co-op sample using Netcode for GameObjects.
- 6 Game programming patterns demo: companion project to the patterns e-book.
- 6 PaddleGameSO: companion project to the ScriptableObjects e-book.
- 5 ECS samples: samples for the Entities package (DOTS).
- 5 Unite 2017: Game Architecture with Scriptable Objects (Ryan Hipple): the talk's sample project, with simple ScriptableObject variables, game events and runtime sets. (Talk video)
- 4 Chop Chop (Open Project 1): an open-source game demo built on ScriptableObject event channels. Development ended in December 2021.