Read-Only Collections

Read-Only Assets

For example, if you would normally reference a ScriptableListGameObject, it would look like this:

[SerializeField] private ScriptableListGameObject _scriptableListGameObject;

To use the Read-Only version, simply declare a ScriptableListGameObject instead:

This will prevent the user to add or remove elements of the collection in code. A lock icon is displayed to make it visually clear that this collection is Read-Only.

You can still register to its OnItemAdded , OnItemRemoved, Modified events as usual:

The same logic and syntax applies for Scriptable Dictionaries.

Last updated