Unity Enter Play Mode Settings: diagnosing stale static state across Play sessions when Reload Domain is disabled
0 reputation · 04 Aug 2020, 20:31 UTC
0 reputation · 04 Aug 2020, 20:31 UTC
Project Settings > Editor > Enter Play Mode Settings allow disabling Reload Domain and Reload Scene for faster iteration. With Reload Domain disabled, the AppDomain persists across Play sessions, so static fields, cached singletons, and some event subscriptions survive and a run can reflect prior state rather than a clean start. With Reload Scene also disabled, runtime edits to the open scene persist, so Awake and Start paths may not execute as in a build.
The trade-off is project-specific: iteration time saved by skipping reloads must be weighed against stale static state, and balance changes with project size, static-state usage, and whether reproducible Play sessions matter. Version sensitivity adds uncertainty, as these options and RuntimeInitializeLoadType members were refined across the 2019.3-era through current LTS and Unity 6 releases, so defaults and supported load types must be confirmed per Editor version.
The hook, [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)], runs each Play session even when domain reload is disabled, but relying on it requires confirming that every static path is covered. Under what conditions should a project disable Reload Domain and Reload Scene while keeping Play sessions reproducible? How can a team confirm that no static state or scene mutation leaks between Play sessions in the Editor version? Which RuntimeInitializeLoadType members and default Enter Play Mode values must be verified against release notes before adopting one?
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.