Inspector Buttons

You can add buttons to your components that appear in the inspector and perform some action.

How to add a button

  • Create a method in your MonoBehaviour. It cannot be static.
  • Add the ProximaButton attribute, with the text that you want to appear.
  • Buttons will appear in order at the top of the component in the inspector.
[ProximaButton("Toggle Spin")]
void Toggle()
    _spin = !_spin;