Hello,
Not sure I’m approaching this correctly, but I’m trying to provide custom data to existing controls - like Buttons.
I’m trying to build an Editor window with buttons for common prefabs in the project.
I would like the buttons themselves in the UXML to define which prefabs to show. In my mind, it would look something like:
<ui:Button text="Game Manager" prefab="GameManager" prefab-folder="Wherever" />
Then in my editor window I would iterate over all the controls with the “Prefab” property, add an onClick to each one, and on the onClick callback get the property value and open the relevant prefab.
Is that possible? I could of course create custom controls for these, but in my mind that means a lot more code, not to mention creating new classes for each such control - whereas if I could just provide any custom attributes on any type of control that would be much simpler I believe.