madsbangh / EasyButtons

Add buttons to your inspector in Unity super easily with this simple attribute
MIT License
1.08k stars 83 forks source link

I cannot use EasyButtons with NaughtyAttributes #19

Open AlkanAkisu opened 3 years ago

AlkanAkisu commented 3 years ago

I think they both use Button Attribute so it makes it to conflict in button method

rfadeev commented 3 years ago

Hi,

This is due to Unity not supporting several custom property drawers. The potential solution is to either create your own attribute and property drawer to draw both EasyButtons and NaughtyAttrubutes buttons. Additionally you can check this solution for some ideas: https://forum.unity.com/threads/drawing-a-field-using-multiple-property-drawers.479377/

Hope this helps!

maferVV commented 2 years ago

Hi, I'm trying to make NaughtyAttibutes and EasyButtons compatible too. I figured it would be easier to just delete NaughtyAttributes [Button] and leave EasyButton's Button attribute intact. Just deleting the button attribute file is not enough though, because somehow the mere presence of the EasyButtons files on the project makes it as if NaughtyAttributes does not even exist, giving errors about not recognizing the NaughtyAttrinutes name.

If I were to use the solution in the link you posted, where should I implement the new parent scripts and which elements of the plugins should be changed? NaughtyAttributes has even their own custom editor that references all property drawers inside it. Sorry if my questions are not clear. The big amount of files on each plugin just makes everything seem so convoluted.

Artemis-chan commented 1 year ago

I tried incorporating ButtonDrawer using Type.GetType into NaughtyAttribute's drawer here. Currently it can be tried by using adding to package manager with the git link https://github.com/Artemis-chan/NaughtyAttributes.git?path=Assets/NaughtyAttributes#easy-button-support Also I did it on the optimized fork from nikosassets, which I will be using: https://github.com/Artemis-chan/NaughtyAttributes.git?path=Assets/NaughtyAttributes#optimized

One issue I found is sometimes if EasyButtons is installed after NaughtyAttributes, EB overrides the drawer until restarted.