Adding a component in editor mode by selecting an Enum.

Hello the question is simple. I have an Enum with 3 kinds of items (options). I want that when the player selects an item from that list in the editor, the Script that contains the behavior of that selection is added automatically to the game object and the other items previously selected (added) get removed.

Thank you. Hope someone could help me with that.

Create a window, iterate over your enum and add buttons to the window. When the user presses a button, look to see if a GO is selected, and add the script. I think the docs just about cover it. If you are struggling, just post the code you’ve written and ask for help.