Skip to content

Add an AdvancedDropdown based attribute - #181

Open
krisrok wants to merge 8 commits into
dbrizov:masterfrom
krisrok:advanceddropdown
Open

Add an AdvancedDropdown based attribute#181
krisrok wants to merge 8 commits into
dbrizov:masterfrom
krisrok:advanceddropdown

Conversation

@krisrok

@krisrok krisrok commented Sep 1, 2020

Copy link
Copy Markdown
Contributor

Adds an attribute and drawer around Unity's AdvancedDropdown class. Code is based on the existing Dropdown and can be used with IDropdownList.

@krisrok

krisrok commented Sep 1, 2020

Copy link
Copy Markdown
Contributor Author

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.

@RunninglVlan

Copy link
Copy Markdown

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.

@krisrok

krisrok commented Apr 20, 2022

Copy link
Copy Markdown
Contributor Author

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?

@RunninglVlan

RunninglVlan commented Apr 20, 2022

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants