Class ProductSceneCacheLoader
Loads product from a scene cache
Namespace: Unity.Industrial.Forma.Core.AddressableSources
Syntax
[MovedFrom(true, "UnityEngine.Industrial.Configuring.ConfiguratorRuntime", "Unity.Industrial.Configurator", null)]
[Serializable]
public class ProductSceneCacheLoader : IProductLoader
Fields
ProductCache
Products will be first loaded from the scene cache rather than from their addressable asset. This allows for faster editing workflows by not always having to save scene changes to product as they can still be used while in play mode.
Declaration
[SerializeField]
[Tooltip("Products will be first loaded from the scene cache rather than from their addressable asset.")]
public ProductCache ProductCache
Field Value
| Type | Description |
|---|---|
| ProductCache |
Properties
CacheRepository
Gets the cache repository.
Declaration
public GameObject CacheRepository { get; }
Property Value
| Type | Description |
|---|---|
| GameObject | The cache repository. |
ShouldUnload
Gets a value indicating whether [should unload].
Declaration
public bool ShouldUnload { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
Methods
Load(Int32, ProductCacheItem, ProductAddressableLoader, Action<AsyncOperationHandle<GameObject>, GameObject, Boolean>)
Loads the specified index.
Declaration
public AsyncOperationHandle<GameObject> Load(int index, ProductCacheItem cacheItem, ProductAddressableLoader addressableLoader, Action<AsyncOperationHandle<GameObject>, GameObject, bool> postInstantiateProduct)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The index. |
| ProductCacheItem | cacheItem | The cache item. |
| ProductAddressableLoader | addressableLoader | The addressable loader. |
| Action<AsyncOperationHandle<GameObject>, GameObject, Boolean> | postInstantiateProduct | The post instantiate product. |
Returns
| Type | Description |
|---|---|
| AsyncOperationHandle<GameObject> | AsyncOperationHandle<GameObject>. |
OnValidate()
Called when [validate].
Declaration
public void OnValidate()
PostUnload()
Posts the unload.
Declaration
public void PostUnload()
Unload(Product, AssetProductReference, ConfigurationManager)
Unloads the specified product.
Declaration
public void Unload(Product product, AssetProductReference currentLoadableProductPrefab, ConfigurationManager configurationManager)
Parameters
| Type | Name | Description |
|---|---|---|
| Product | product | The product. |
| AssetProductReference | currentLoadableProductPrefab | The current loadable product prefab. |
| ConfigurationManager | configurationManager | The configuration manager. |