← ClaudeAtlas

unity-coding-habitslisted

Good Unity C# habits that hold in any project: serialize private fields instead of exposing public ones, keep lookups out of per-frame code, treat destroyed `UnityEngine.Object`s as the fake null they are, pick one way to find things instead of mixing singletons and scene searches, keep types small and namespaced, and never restyle code you are only passing through. Use when writing or changing a `MonoBehaviour`, `ScriptableObject` or any C# under `Assets/`, including tests; "is this MonoBehaviour right", "clean up this component", "how should I write this component", "how do I test this", "write a PlayMode test", "/unity-coding-habits". Reviewing a change is `unity-review-change`; diagnosing a game that already runs badly is `unity-debug-runtime`.
Xenoneqq/unity-ai-skills · ★ 1 · Code & Development · score 74
Install: claude install-skill Xenoneqq/unity-ai-skills
# Unity coding habits Clean, readable code is the point. Every rule below has a reason — correctness, performance, readability, or compile time. Where the reason does not apply, neither does the rule. **The project outranks this file.** If the repo documents its conventions — `CLAUDE.md`, `CONTRIBUTING.md`, contributor notes — or the surrounding code clearly and consistently demonstrates one, follow that. These are the fallback for when nothing says otherwise. **Do not restyle code you are passing through.** Smallest diff that solves the task. Renaming fields, adding `[SerializeField]`, extracting helpers or converting coroutines in code you merely touched turns a reviewable diff into an unreviewable one — and in Unity a field rename silently drops every value already serialized in a scene or prefab. Converting old code is real work: propose it, get it agreed, and do it deliberately — `unity-legacy-migration` is that job, and it carries the procedures that keep references and stored values intact. | Reference | Read it when | |---|---| | [references/serialization.md](references/serialization.md) | Adding or renaming a serialized field, writing a `ScriptableObject`, or the inspector shows the wrong value. | | [references/per-frame.md](references/per-frame.md) | Writing `Update`/`FixedUpdate`, chasing frame cost or GC spikes, or writing a coroutine or `async` method. | | [references/wiring.md](references/wiring.md) | Deciding how one object finds another, loading assets at