Skip to content

Unity: code architecture

How to structure gameplay and application code so it stays changeable as the project grows.

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

Key rules

Structure

Data and ScriptableObjects

Dependencies and communication

Async and scale

Accessibility

  • 6 UNITY-CODE-15 For screen reader support, build an accessibility hierarchy with Unity's Accessibility module: an AccessibilityNode with a label, role and state for each element that players read or use, set as AssistiveSupport.activeHierarchy while that UI is shown, and kept in sync with the UI, including each node's screen position, in your own code. In Unity 6.3 LTS and later, the module drives TalkBack, VoiceOver and Narrator on Android, iOS, macOS and Windows, but it doesn't derive the hierarchy from the scene, so test with each target screen reader; on Android and iOS, AccessibilitySettings also reports the font scale, bold text and closed caption settings. This applies A11Y-9 and A11Y-12. (Unity Manual, Introduction to the Accessibility module, Unity Manual, Get started with screen reader support)