Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Game development
/
MonoBehaviour lifecycle
Why should OnDestroy not be the only release path for a mandatory external resource?
from MonoBehaviour lifecycle
Unity 6.6
intermediate
1 min
Why should OnDestroy not be the only release path for a mandatory external resource?
Unity calls OnDestroy only for objects on GameObjects that were active at least once.
OnDestroy always runs before Awake.
OnDestroy cannot contain ordinary C# method calls.
Unity invokes OnDestroy once per rendered frame.
Check
Ask AI about this kata
Report an error
previous kata
A MonoBehaviour starts a coroutine, then code sets component.enabled = false while its Ga…
Quiz
next kata
An initially active, enabled component finishes Start, then another component calls Cycle…
Predict the output
A new version is available
Reload