An abstract class in Alta.VContainerLayer.Runtime, the global namespace.
Base for factories that spawn a prefab loaded through Addressables. The prefab's AssetReference is injected, and loaded handles are released on dispose.
- Listed in Other Alta assemblies
- Inherits or implements
Factory
- Derived types
FactoryAsync<TConcrete, TInterface>, FactoryAsync<TParam, TConcrete, TInterface>, FactoryAsync<TParam1, TParam2, TConcrete, TInterface>, FactoryAsync<TParam1, TParam2, TParam3, TConcrete, TInterface>
Constructors
| Member | What it is |
|---|
protected FactoryAsync() | Creates a FactoryAsync with default values. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private readonly List<AsyncOperationHandle> assetHandles | Addressables load handles taken so far, released in Dispose. |
private AssetReference prefabReference | The Addressables reference of the prefab this factory instantiates. |
Methods
| Member | What it is |
|---|
override void Dispose() | Releases every Addressables handle this factory loaded, then disposes the created instances. |
protected void Construct(AssetReference prefabReference) | Injection method that stores the Addressables prefab reference to load. |
protected Task<GameObject> LoadAsset() | Starts loading the prefab through Addressables, keeps the handle for release, and returns the load task. |