Scriptable SubAssets
Scriptable SubAsset
Last updated
Scriptable SubAsset
Last updated
Sometimes, you want to group several scriptable variables, lists, events, or enums together. You can assign them the same Tag (for example, Player) so that you can easily filter them in the Soap Wizard. However, even though this is useful, they still exist as individual assets. For these cases, you can use the [SubAsset] attribute to make them children of a specific scriptable object. For example, let’s imagine we want to group all player stats-related scriptable variables under a single SO. We can do it like this:
The [SubAsset] attribute works on [SerializeField] private or public Soap SOs. When marking a Soap SO with the [SubAsset] attribute, it will be displayed in your scriptable object wrapper like this: