monobehaviour
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
monobehaviour [2021/05/22 01:25] – [OnBecameInvisible()] 151.204.147.19 | monobehaviour [2025/01/15 04:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 14: | Line 14: | ||
* Start is guaranteed to be called before the first FixedUpdate() or Update() for **this** component. | * Start is guaranteed to be called before the first FixedUpdate() or Update() for **this** component. | ||
* If no FixedUpdate() or Update() events are defined, Start will be run at the end of the frame the object awoke on. | * If no FixedUpdate() or Update() events are defined, Start will be run at the end of the frame the object awoke on. | ||
+ | |||
+ | ==== OnDisable/ | ||
+ | |||
+ | |||
+ | * Both events are not affected by script execution order. | ||
+ | * Scene is traversed from each root separately in unspecified (non-hierarchy) order, e.g. [root 1 and all its children], [root 2 and all its children]. " | ||
+ | * All OnDisable calls are performed before all OnDestroy calls within a single root. | ||
+ | * Only root GameObject '' | ||
+ | * Components are traversed in the order they appear in Inspector, top to bottom. | ||
+ | * **OnDisable**: | ||
+ | * Call order: same as hierarchy, child before parent. :!: | ||
+ | * '' | ||
+ | * **OnDestroy**: | ||
+ | * Call order: same as hierarchy, parent before child. :!: | ||
+ | |||
+ | (Above Tested with 2017.4 and an opened Scene running in play mode in editor by stopping the play mode, may differ for other versions/ | ||
==== OnBecameVisible() ==== | ==== OnBecameVisible() ==== |
monobehaviour.1621646731.txt.gz · Last modified: 2025/01/15 04:35 (external edit)