Fast ScriptableObject Creation in Unity

ScriptableObjects can be a very useful feature of Unity but they’re a hassle to create. Here’s a way to do this quickly:

Scriptable Object Context Menu

Scriptable Object Context Menu

In the stock interface there is no way to create ScriptableObjects. Most solutions I found solve this by adding a MenuItem to the top bar. This item then creates a ScriptableObject .asset file of a specific class. This is works but it requires you to adjust the script for each project so it points to a class of that pr oject. It also requires you to create a specific script for each of your classes, even if that might otherwise not be neccessary.

Our ScriptableObjectContextEditor script avoids these problems. Instead of the clumsy menu, it allows you to create .asset files directy from the project pane, where you’d expect it. Not only that, it also has an implementation that allows you to select a script file from which to create an asset, so you don’t need to adjust the script for each project. However if you want to do that you can make use of a generic function provided to create additional pulldown options for specific classes of your own.