Source metadata
- Type: Official Unity e-book
- Maintainer: Unity
- Date on source page: 2025-01-21
- Primary URL: C# Code Style Guide
Key takeaways
- Unity treats code style as a team productivity issue: predictable names and file structures reduce cognitive load when many people touch the same project.
- The guide repeatedly prefers small methods and small classes over large mixed-responsibility scripts.
- Shared configuration such as EditorConfig is presented as a practical way to keep formatting consistent across IDEs and version control.
- The e-book also extends style guidance into UI Toolkit naming, pushing teams toward web-like conventions for UXML, USS, and related assets.
Notable claims
- Style conventions are most useful when they are enforced consistently across a team, not left as personal taste.
- Naming and method structure are part of readability, debugging speed, and onboarding, not just aesthetics.
- Unity’s UI Toolkit benefits from explicit naming discipline because code, UXML, and USS need to stay aligned.
Relevance
This source primarily informs:
It also supports:
Open questions raised
- How strict should the vault be about prescribing Unity-flavoured naming conventions versus general C# conventions?
- Which parts of the guide should be treated as strong defaults and which should remain team-specific preferences?