A Unity scene holds objects such as the Camera and GameObjects. In a data-oriented architecture, using one scene can keep game state under the game’s direct control instead of dividing it across scene loads. section 5.1.4 section 5.5
Consider whether a game difference needs a separate scene or can be represented as data:
- Treat levels as data: store enemy spawns, background, music, and win or lose conditions, then load the chosen level’s values. section 5.1.4
- Treat menus as data and UI: change the menu state and show or hide the relevant UI GameObjects. section 5.1.4
- Keep game flow in Game and current state in GameData; let the game loop use that data to drive the scene’s objects. section 5.1.4
Switching levels
To play a different level, load different level data rather than loading another Unity scene. This avoids managing which scene is active, which objects persist, and how state moves between scenes. section 5.1.4
