NaughtyAttributes
NaughtyAttributes copied to clipboard
Add an AdvancedDropdown based attribute
Adds an attribute and drawer around Unity's AdvancedDropdown class. Code is based on the existing Dropdown and can be used with IDropdownList.
I added some info and an image in the readme and tried to keep it in sync with the other stuff in the readme. Feel free to shorten the example as it is a bit long.
The oldest version I tested on was 2018.4.x but I expect it to work on 2018.3 as well. Just fyi as you have 2018.3 in your specs.
Nice one!
Found an issue though, although it may be Unity's (I'm using 2022.1.0b12.2880, reproduced in 2022.1.0b16 too).
Asset isn't marked as Dirty, so I added EditorUtility.SetDirty(property.serializedObject.targetObject);
after ApplyModifiedProperties
and it fixed the issue.
Strange, SetDirty
should not be neccessary in this case.
I've tested the DemoScene with 2020.3 and 2021.3 and changing the value dirties the scene. Selecting the current value in the dropdown again on the other hand does not set the scene dirty. (Your fix would always set it dirty, but that's a minor annoyance I'd say.)
Can you maybe confirm your described behaviour with the DemoScene in your 2022.x installations? Maybe it just does not work with your current class, mabye due to Unity's serialization?
As far as I remember, it worked for me too in Scene and Prefabs (when they are opened), but it doesn't for ScriptableObjects and if Prefabs are not opened Oh yeah, and the same behavior is with simple DropdownAttribute