Creating prehabs in the Project window in code?

Is it possible? So far I understand that you can do things in the GUI and in the game. So far I can instantiate objects from a prehab in code and also do it in the editor. However can you create things in the Project window instead of the Hierarchy window?

For example, here is what I want to do. In C#

I have a loaded mesh called “enemy”

I want to duplicate it to “bigenemy”
Then add a box collider, then a rigid body, and finally add the bigenemy.cs

Right now in the GUI I press CTRL+D to duplicate, then I manually add the collider and rigidbody using the drop down menus and then drag the script onto the prehab.

What I want to do is automate all this in a button.

Is it possible?

Thanks for reading. :slight_smile:

Yes, RTFM around here: