Performance: Scene loading and unloading
HIGH IMPACT
This affects how fast the game loads new content and frees memory, impacting frame rate and user experience during scene transitions.
await SceneManager.LoadSceneAsync("Level2").ToUniTask();
SceneManager.LoadScene("Level2");| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous scene load | Blocks main thread | Blocks rendering | High paint cost due to freeze | [X] Bad |
| Asynchronous scene load | Non-blocking | No reflows during load | Low paint cost, smooth frames | [OK] Good |
| No scene unload | Memory grows | Potential frame drops | High paint cost over time | [X] Bad |
| Unload unused scenes | Frees memory | Stable rendering | Low paint cost | [OK] Good |