Value Lists
ValueLists are the go-to collection type in Unity Atoms. You can think of it as a AtomVariable<List<T>>.
A common use case is storing a list of Enemies for easy access.
Creating an Enemy Prefab
- Adding a Cube to the Scene and creating a prefab out of. I named it "AngryCube".
- Now add a
Sync GameObjectToListcomponent to the prefab. This will automatically add instances of the prefab onto the list onStart(and removes themOnDestroy) - Press the
[Create]Button on theSync GameObjectToListcomponent to create a new ValueList asset, we name it "ListOfEnemyGameObjects".
- In play mode, we can now observe the ValueList asset and see how gameobjects are added to it on start and removed when leaving the play mode.