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:
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.
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