Skip to content

code-conventions-unity

Code Conventions — Unity / C# (The1Studio prohibitions)

Section titled “Code Conventions — Unity / C# (The1Studio prohibitions)”

Extends core code-conventions.md. Only the deviations/prohibitions that must hold while writing — the full convention set lives in t1k-unity-base-code-conventions, the authoring-time SSOT.

Prohibitions (always-loaded, reviewer-facing)

Section titled “Prohibitions (always-loaded, reviewer-facing)”
  • DOTween is BANNED — no new using DG.Tweening;/.DO*(); migrate existing usages on touch. LitMotion ONLY — zero-alloc, Burst-adjacent, MIT.
  • VContainer ONLY — never Zenject (legacy, #if GDK_ZENJECT only). Events via SignalBus. Subscribe/unsubscribe with named methods, not lambdas.
  • UniTask over coroutines for new async; R3 for reactive binding. Dispose subscriptions in OnDestroy() — track IDisposable.
  • Private fields camelCase, NO underscore prefix, this. mandatory for member access. [SerializeField] private — always private, no underscore.
  • UPPER_SNAKE_CASE constants; PascalCase enums/values. Namespaces ProjectName.Feature.Component, max 3–4 levels.
  • Logic/presentation split (MonoBehaviour only): pure game logic stays testable without booting the engine (t1k-game-arch). Does not apply inside ISystem — it + its IComponentData already IS the tested logic layer.

A convention not covered here: ask, then update the skill. A deviation stated above wins over the skill.

t1k-unity-base-code-conventions — casing tables, DI, DOTS specifics, editor-script standards, anti-patterns.

code-conventions.md (core) · mono-pool-spawn-unity.md · prefab-only-construction-unity.md · game-feedback-mandate-unity.md · t1k-game-arch