From a high-level perspective, entering Play Mode consists of the following main stages:
The combined tasks of Domain Reload and Scene Reload resets the scripting domain and simulates the startup behavior of your application as it would run in the player. Unity skips these steps when you disable them in your Project Settings.
The diagram below provides detailed information about the exact events which Unity skips when Domain Reload and Scene Reload are disabled. Blue indicates the events Unity skips when Domain Reload is disabled, and green indicates the events Unity skips when Scene Reload is disabled.
With Scene Reloading and Domain Reloading enabled, this is the full list of all processes and events that Unity performs when entering Play Mode:
beforeAssemblyReload
event is raised.OnDisable()
is called for all ScriptableObjects and MonoBehaviours.OnBeforeSerialize()
is called.[NonSerialized]
.AppDomain.DomainUnload
event is raised.OnAfterDeserialize
event is raised.OnValidate()
is called.[ExecuteInEditMode]
attribute:OnEnable()
is called.OnDisable()
is called.OnDestroy()
is called.afterAssemblyReload
is called.