Asset Lists

Pro Only: Weaver Lite allows you to try out asset lists in the Unity Editor, but they will always be empty in a runtime build unless you purchase Weaver Pro.

An AssetList is a ScriptableObject which automatically gathers all assets of a given type in a specific folder into a list. This is useful in a variety of circumstances, such as:

  • If you want to put all enemy prefabs into a dictionary so that you can refer to them by name or some other identifier.
  • If you have a set of slightly different footstep sounds you can play a different with one each step instead of playing the same one repeatedly.
  • If you have an in game level editor you could use a list to gather all the different kinds of blocks or other tools you can use.
  • The Missiles example uses a list of missile prefabs so it can pick a random one to fire with each shot.
  • The Item Shop Example uses a Meta Asset List to show information about the items (meta data) without actually loading any of the item prefabs until they are needed.

You can add new assets to the list by simply putting them in the target folder. Gathering takes place automatically in the Unity Editor so the list can be loaded efficiently at runtime and assets don't need to be in a Resources folder.

All assets in a list are given an overlay icon in the Project window with a tooltip indicating which list (or lists) they are included in. You can right click on the icon to open a context menu with functions to select the list asset or highlight it in the Asset Lists panel.

Creating a List Use Assets/Create/Asset List, set the Directory, and choose the Asset Type.
Lazy Asset Lists A regular asset list will load its assets into memory immediately when the list is loaded, which isn't always desirable.
Procedural Asset Lists You can procedurally generate the assets in an Asset List.