Submitted by abitowhit on Mon, 05/16/2022 - 18:50

The ability to add variables in scripts which are available in Unity allows you to
edit them or add game objects directly in the Unity Editor under the Inspector tab.
This is quite handy, allowing you to drag/drop game objects, audio sources, animations, etc
directly in the editor. Adding headers and tooltips will organize and provide some description on what the variables are for.
Example
[Header("Settings")]
[Tooltip("Destroy Time ")] [SerializeField] private float destroyTimer = 2f;
It also allows you to change variables to the script when testing in game mode.
I occasionally toggle a boolean value to force parts of a script to execute in game mode in the editor.