Accessing SubAssets

Scriptable SubAssets

The [SubAsset] attribute can only be used on Soap SOs referenced in wrappers of type ScriptableObjects (or classes inheriting from SOs). You can access a particular sub-asset in two different ways:

  1. The same way as any other SO, by exposing a reference and dragging a specific instance. Example: expose a reference to a FloatVariable and then select the _speed FloatVariable.

  2. By exposing a reference to the wrapper (PlayerStats) and accessing it through that. Example: playerStats.Health.Add(10).

For more details and examples, please refer to the documentation and the scene 7_ScriptableSubAssets_Example_Scene.

Last updated