This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
monobehaviour [2021/04/30 15:10] 73.95.178.156 |
monobehaviour [2022/01/28 17:26] (current) 73.217.35.3 |
||
---|---|---|---|
Line 15: | Line 15: | ||
* 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() ==== | ||
+ | * Does not get called if the game object is rendered by a ugui CanvasRenderer | ||
+ | |||
+ | ==== OnBecameInvisible() ==== | ||
+ | * Does not get called if the game object is rendered by a ugui CanvasRenderer |