Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

SceneObjectField in HUXEditorUtils fails when two components of the same type are on a single game object #25

Description

@YoriKv

https://github.com/Microsoft/MRDesignLabs_Unity_Tools/blob/ec32b17034e2950784d084f838bd2b858bdc7b23/HUX/Editor/Utility/HUXEditorUtils.cs#L236-L267

If the component type that SceneObjectField is looking for is present twice on the same object, the dropdown/popup portion of this field implementation fails and will always select the first of the two components.

This appears to be an issue with EditorGUILayout.Popup(selectedIndex, displayedOptions) ignoring duplicate entries. Solution would be to include a unique component to the string in displayedOptions, such as the index of the entry so there is never a duplicate string.

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions