dbrizov / NaughtyAttributes

Attribute Extensions for Unity
MIT License
4.52k stars 465 forks source link

Any way to make this compatible with Odin or Markup Attributes? #304

Open 3ternal opened 2 years ago

3ternal commented 2 years ago

I still use Odin in my project, and I later started using this attribute library as well: https://github.com/gasgiant/Markup-Attributes

Naughty seems great, and I like the Required and ValidateInput attributes, but I'm not quite ready to remove MarkupAttributes or Odin yet. It's a lot of extra work to change all of your old attributes every time you try a new asset.

While I haven't tested this fully, it seems that NaughtyAttributes stops working as soon as you import Odin from the asset store, or as soon as you add the CustomEditors required to implement MarkupAttributes.

rhys-vdw commented 2 years ago

FYI Odin has both RequiredAttribute and ValidateInput.

3ternal commented 2 years ago

I know that Odin can do it, but I'm trying not to rely on it for a couple of reasons (it has broken serialization in other Unity classes before, and their licensing model is pricey once you pass a particular income threshold).

I just got Required working with my own CustomPropertyDrawer, so that's cool, but I probably won't be able to use Naughty for this project if it's mutually exclusive with the other two.

TylerTemp commented 11 months ago

I don't know about Markup, but for Odin, the answer is mostly NO.

For the following reasons:

  1. Like Odin, NaughtyAttributes inject an global CustomEditor, in which is mostly incompatible with each other
  2. NA has a much better fallback system (respect Unity's default workflow) to allow many custom drawer works, but Odin is much much more aggresive. Odin mostly only fallback to Odin's drawers or Unity's default drawer. (Well, fairly speaking, NaughtyAttributes does not respect the GUIContent passed down from a UnityEditor.PropertyField, which is also a Unity's (bad designed) workflow)

If you're interested you can read more on the description on my similar project but without a CustomEditor, in the "Other Drawers" part

3ternal commented 11 months ago

I don't know about Markup, but for Odin, the answer is mostly NO.

For the following reasons:

  1. Like Odin, NaughtyAttributes inject an global CustomEditor, in which is mostly incompatible with each other
  2. NA has a much better fallback system (respect Unity's default workflow) to allow many custom drawer works, but Odin is much much more aggresive. Odin mostly only fallback to Odin's drawers or Unity's default drawer. (Well, fairly speaking, NaughtyAttributes does not respect the GUIContent passed down from a UnityEditor.PropertyField, which is also a Unity's (bad designed) workflow)

If you're interested you can read more on the description on my similar project but without a CustomEditor, in the "Other Drawers" part

Seems neat, I might check it out next time I need something like this. I ended up sticking with Markup Attributes, and I kept Odin around just for compatability with older objects in the project.