Automatically Set .asmdef Platforms When Name Ends with ".Editor"?

I had an idea for a tiny feature suggestion, that I’m not sure would be great or not in all cases/scenarios,

But I was wondering – what if Unity could just set the Platforms to editor-only when you right-click, create a new Assembly Definition Asset, and the name ends with “.Editor”?

For example, this would trigger if I created a new Assembly Definition Asset at Assets/Scripts/Example.Editor/Example.Editor.asmdef.

That way, I could save a bunch of clicks every time I create an editor-only assembly definition.
Would this be useful in others’ projects, or would others find this little feature potentially annoying in some cases?

Basing the intent on naming only is potentially catastrophic, especially for existing projects.

But I do agree with you, there should be a quicker way than to:

  • uncheck Any platform
  • scroll down
  • deselect all
  • scroll up
  • check Editor

Two ideas: either the Asset create menu adds a “Editor Assembly Definition” - which may be possible with a custom editor script today actually.

Or my favorite: have a checkbox right below “Any platform” that says “Editor only” and make those two checkboxes mutually exclusive.

1 Like