MyBox icon indicating copy to clipboard operation
MyBox copied to clipboard

Request: Compatibility with Naughty Attributes

Open XardoX opened this issue 4 years ago • 5 comments
trafficstars

Hi! Is there a possibility to make MyBox compatible with https://github.com/dbrizov/NaughtyAttributes?

XardoX avatar Jul 30 '21 13:07 XardoX

No, unfortunately it's not possible by technical reasons. What features do you use the most from NaughtyAttributes? I may create my own versions of such features 🙂

Deadcows avatar Aug 20 '21 06:08 Deadcows

BoxGroup, ResizableTextArea, InfoBox, OnValueChanged

XardoX avatar Aug 26 '21 12:08 XardoX

To combine multiple libraries, such as NaughtyAttributes, MyBox, and Unity Editor Toolbox, we need to merge their CustomEditor(Object) implementations, right?

https://github.com/Deadcows/MyBox/blob/master/Tools/Internal/UnityObjectEditor.cs https://github.com/arimger/Unity-Editor-Toolbox/blob/aabf50dfc5b924906de69d0146039fc229a3efd4/Assets/Editor%20Toolbox/Editor/ToolboxEditor.cs https://github.com/dbrizov/NaughtyAttributes/blob/master/Assets/NaughtyAttributes/Scripts/Editor/NaughtyInspector.cs

cspotcode avatar Nov 24 '21 17:11 cspotcode

Looks like MyBox defers to the built-in inspector GUI unless foldout needs to do stuff, and it renders ButtonMethods before and after.

Foldout has to do the same kind of custom overriding, which is why MyBox had to implement special support for it. https://github.com/PixeyeHQ/InspectorFoldoutGroup/blob/master/Homebrew/DecorateFoldout/Editor/EditorOverride.cs

Theoretically, if some sort of a pluggable system was built for this kind of inspector replacement, then these various libraries could coexist by using this pluggable system. Probably tricky to implement well, and then you'd need everyone to agree to use it.

cspotcode avatar Nov 24 '21 17:11 cspotcode

Well I think the best and easiest step for now is to allow conditionally disable Foldout and ButtonMethod for compatibility with such libraries. It's not the worst sacrifice I think

Deadcows avatar Nov 29 '21 08:11 Deadcows

I'm mostly missing the ValidateInput system. As well as showing warnings and error messages on variables

Podden avatar Oct 06 '23 11:10 Podden

I'm mostly missing the ValidateInput system. As well as showing warnings and error messages on variables

Good stuff. I think this functionality could be easily combined with MustBeAssignedAttribute. I'll look into that 👍

Deadcows avatar Oct 07 '23 18:10 Deadcows

It's been a long time, but finally I made UnityObjectEditor optional. Disable "Inspector override" toggle in MyBoxWindow for compatibility for some other libraries. It is required for [ButtonMethod] and [Foldout] attributes to work though.

Deadcows avatar Jan 09 '24 14:01 Deadcows