Can I make an editor script for the Unity Input Actions Editor?

I’m working in the Unity Input System, and I’m using the Generate C# Class button found in the inspector of the .inputactions file. I’d like to add a button to the Input Actions Editor itself, this button serve to create a new C# script tailored to fit my preferred input action setup. It would be responsible for a single Action Map, so I’d like to add it to the Editor so that I can select an action map in the left column, and then somewhere else there would be a button for “Generate C# Class” and the button would generate the class specifically for that Action Map. It would have the interface already, as well as events for each action within the action map already laid out.

Overall, this would save me time whenever I start a new project so I wouldn’t need to make 3 or more new ones each time since each project would have multiple maps. Ultimately, the button could go somewhere else, but I would have a strong preference for putting it on the Input Action Editor itself so that I can just click the button immediately after making any adjustments to the input actions.

Apologies if this is an easy question, or an impossible task. I’m not familiar with writing custom editors for the Unity Editor itself, I’ve only written buttons for the inspector panel. If it possible to make edits, all I’m looking for is to add a button, and make the button call a function. I know how to do the rest. Just not familiar with editor stuff.

Thanks!

Packages are distributed as source, so you can always peek through the code yourself to see whether this is possible or not.

But the editor window alone for this is internal, so gonna assume this is not possible without considerable hacks. Seems like pretty much everything editor-related to the Input System is internal, too.

You’d be better off just making your own simple editor window for this.

I asked having forgotten that custom editor windows are possible, and actually pretty much the same difficulty to make as custom inspectors. Thanks! This is also my first time making a custom window but now I know what I’m looking for so I can way easier find solutions to problems as they arise.

1 Like