Documentation

Unity Engine

Download Unity

Unity Engine

Unity's code lifecycle

Understand the lifecycle of code in Unity, from code load, unload, and reload in different contexts.
Read time 1 minuteLast updated 2 days ago

During the period of its availability, code is loaded, initialized, executed, decommissioned, and unloaded or destroyed. This sequence of stages through which code transitions is referred to as the code lifecycle.

Topic

Description

Accessing the code lifecycleUse Unity's lifecycle APIs to hook into key stages of the code lifecycle to perform setup and cleanup work or handle Edit mode and Play mode transitions.
Code lifecycle execution order referenceUnderstand the execution sequence of lifecycle API callbacks and other events during code loading, unloading, and reloading in the Unity Editor and Player.

Additional resources