Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Making a popup of actions in a custom editor. Is it possible?

Discussion in 'Input System' started by frumple314, Apr 21, 2021.

  1. frumple314

    frumple314

    Joined:
    Jun 18, 2018
    Posts:
    6
    Is it possible to make a popup in a custom editor that allows one to select the action the input system will use to affect it?

    In my case I have a Item script where I want to be able to populate with an array of "item properties" such as causing damage to a raycast hit, playing an type of effect, gathers resources, etc. These essentials of these are stored in a struct which contains the type of property and I want to also store the kind of action triggers this property.

    What I want is for each property listed in the editor for the Item script I want a drop down next to it that lists all the possible actions for my current ActionMap. The code will then take care of triggering the property when the player does the appropriate input action.

    As a proof of concept, I can get it to work if I define an enum with the actions, but I want to be able to populate this popup based on what actions are in the ActionMap or even a subset of those actions.

    Any ideas of how to do this in a custom editor?