This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
monobehaviour [2021/04/30 13:35] 177.45.132.86 |
monobehaviour [2021/04/30 15:08] 73.95.178.156 |
||
---|---|---|---|
Line 4: | Line 4: | ||
==== Reset() ==== | ==== Reset() ==== | ||
- | * This function | + | * Reset is only called in editor mode. |
* Reset is called when adding the component for the first time on a GameObject. | * Reset is called when adding the component for the first time on a GameObject. | ||
- | * Also, it is called when the user hits the Reset button in the Inspector' | + | * It is called when the user hits the Reset button in the Inspector' |
* Very useful to setup values for your attributes, i.e. find a child component. | * Very useful to setup values for your attributes, i.e. find a child component. | ||
* Use it with the RequireComponent attribute to always get a reference for your component. | * Use it with the RequireComponent attribute to always get a reference for your component. |