WooshiiDev / WooshiiAttributes

A growing collection of flexible, powerful Unity attributes
MIT License
36 stars 3 forks source link

Button attribute #1

Closed TheDutchMagikarp closed 3 years ago

TheDutchMagikarp commented 3 years ago

I want to clickity clack in the inspector so I don't have to write key input code for testing methods pls help I don't need no fancy parameters or whatever, just run a method from an inspector button that I added the attribute to. Being able to put a text on the specific button by doing [Button("Name of Button")] would be nice, but not required. It could default to the method name?

WooshiiDev commented 3 years ago

Added a simple button attribute with the following: [MethodButton(string buttonName)]

I've made the attribute name explicitly state button, just in case there's any other future buttons or attributes that require methods in the future.

There's no arguments right now but I'll look into that in the future.

WooshiiDev commented 3 years ago

Here's how it should show up

image

WooshiiDev commented 3 years ago

Added a quick commit so that they default to the method names if one is not provided

WooshiiDev commented 3 years ago

Closing for now as button has been implemented, but will reopen when arguments are added