Attributes within Unity are tags you can add to member fields or methods. The Attributes category provides a few additions to the default attributes of Unity, mainly for enhanced inspector editor functionality.
Add the [EditorButton] attribute to any public method in order to show a button within the Inspector UI, which upon click, will call the method. The game doesn't have to be in play mode in order to call the method. All buttons will be shown on the bottom of the Inspector UI.
Sometimes, you don't want EditorButtons to work while the game isn't playing. In that case, you can add [EditorButton(true)] instead. This ensures that the button is greyed out as long as the game isn't playing.
Add the [ReadOnly] attribute to a field to prevent any changes to it within the inspector GUI, while still having it be visible. While ReadOnly, the field is greyed out.
-