LazyAssetList<T> Class

Summary

An Weaver.AssetList that serializes resource paths so that assets don't need to be loaded until they are first accessed.
Assembly
Weaver.dll
Namespace
Weaver
Interfaces
Base Types
Derived Types
graph BT Type-->Base0["AssetList"] click Base0 "/weaver/api/Weaver/AssetList" Base0-->Base1["AssetListBase"] click Base1 "/weaver/api/Weaver/AssetListBase" Base1-->Base2["ScriptableObject"] Type-.->Interface0["WeaverWindow.IItem"] Type-.->Interface1["IAssetList<T>"] Type-.->Interface2["IEnumerable<T>"] Type["LazyAssetList<T>"] class Type type-node Derived0["MetaAssetList<TAsset, TMeta>"]-->Type click Derived0 "/weaver/api/Weaver/MetaAssetList_2"

Syntax

public class LazyAssetList<T> : AssetList, WeaverWindow.IItem, IAssetList<T>, IEnumerable<T> 
    where T : Object

Type Parameters

Name Description
T

Properties

Name Value Summary
AssetType Type
The type of assets in this list.
Count int
The number of assets in this list.
Directory DefaultAsset
[Editor-Only] The directory from which this list will gather assets.
Inherited from AssetList
IsLazy bool
True. This list will only load its assets as they are needed rather than on startup.
MetaDataType Type
The type of meta data in this list.
Inherited from AssetListBase
Recursive bool
[Editor-Only] If true: this list will gather assets in any sub-directories as well as the target directory.
Inherited from AssetList
this[int] T
Ensures that the asset at the specified index in this list is loaded and returns it.
Tooltip string
[Editor-Only] The text to use to describe this list when showing a tooltip in the Weaver.Editor.Window.WeaverWindow.
Inherited from AssetListBase

Methods

Name Value Summary
AddPath(string) void
Adds the `path` to this list.
AddPaths(IEnumerable<string>) void
Adds the `paths` to this list.
AddPaths(LazyAssetList<T>) void
Adds the paths in the specified `list` to this list.
Clear() void
Clears all the assets from this list.
DoDetailsGUI() void
[Editor-Only] Draws the details of this list in the inspector.
GatherAssets() void
[Editor-Only] Gathers all assets in the target Weaver.AssetList.Directory and stores their resource paths in the serialized Weaver.LazyAssetList`1._Paths list.
GatherAssets<T>(List<T>) void
[Editor-Only] Gathers all assets in the target Weaver.AssetListBase.Directory into the `assets` list.
Inherited from AssetListBase
GatherAssets<T>(List<T>, string, bool) void
[Editor-Only] Gathers all assets in the target Weaver.AssetListBase.Directory into the `assets` list.
Inherited from AssetListBase
static
GatherAssetsIfDirty() void
[Editor-Only] Gathers the assets in the target Weaver.AssetListBase.Directory if they might have changed since this method was last called.
Inherited from AssetListBase
GatherResources<T>(List<string>, List<T>) void
[Editor-Only] Gathers all assets and their resource paths in the target Weaver.AssetListBase.Directory.
Inherited from AssetListBase
GetAndVerifyDirectoryPath() string
[Editor-Only] Returns the path of the target Weaver.AssetListBase.Directory relative to the project root or null if a valid folder isn't assigned.
Inherited from AssetListBase
GetAsset(int) T
Ensures that the asset at the specified index in this list is loaded and returns it.
GetAssetAsync(int, Action<T>) ResourceRequest
If the asset at the specified index in this list is not loaded, this method loads it asynchronously, returns the UnityEngine.ResourceRequest used to do so, and passes it into `onAssetLoaded` when complete. Otherwise this method immediately passes the already loaded asset into `onAssetLoaded` and returns null.
GetEnumerator() IEnumerator<T>
Returns an enumerator that iterates through all assets in this list.
GetIsLoaded(int) bool
Returns true if the asset at the specified `index` has already been loaded.
GetPath(int) string
Gets the path of the asset at the specified `index`.
GetRandomIndex() int
Returns a random index in this list.
Inherited from AssetListBase
LoadAll() void
Ensures that all assets in this list are loaded.
MapPathToIndex() Dictionary<string, int>
Creates a dictionary that maps the resource path of each asset in this list to its index.
OnCountChanged() void
Called when the number of assets in this list changes to ensure that all internal aspects are kept in sync.
OnDisable() void
[Editor-Only] Called by Unity when this list is unloaded. Ensures that all assets in the target Weaver.AssetListBase.Directory are gathered so they can be serialized.
Inherited from AssetListBase
OnEnable() void
[Editor-Only] Ensures that this list is in the global collection of all lists so it can be displayed in the Weaver Window and can show project window overlays on its target assets.
Inherited from AssetListBase
Reset() void
[Editor-Only] Assigns the currently selected object as the Weaver.AssetListBase.Directory if possible.
Inherited from AssetListBase
SetListTypes(Type, Type, Type) void
[Editor-Only] Assigns the list types that need to be defined outside this assembly so they c an be used internally.
Inherited from AssetListBase
static
ToString() string
Returns a description of the contents of this list.
UnloadAll() void
Calls UnityEngine.Resources.UnloadAsset(UnityEngine.Object) on every asset in this list.