Class ProductRepository
Handles product load and unload
Namespace: UnityEngine.Industrial.Configuring.ConfiguratorRuntime
Syntax
[Serializable]
public class ProductRepository
Constructors
ProductRepository()
Initializes a new instance of the ProductRepository class.
Declaration
public ProductRepository()
Fields
OnProductLoaded
The on product loaded
Declaration
public Action OnProductLoaded
Field Value
Type | Description |
---|---|
Action |
productReadyToPlace
Raised when the product is loaded and instantiated. Useful to allow custom placement of the product or to perform additional operations before positioning the product. If there are no observers, the default placement code will be run, which positions the product using the default Transform values.
Declaration
public Action productReadyToPlace
Field Value
Type | Description |
---|---|
Action |
Properties
addressableLoader
Gets the addressable loader.
Declaration
public ProductAddressableLoader addressableLoader { get; }
Property Value
Type | Description |
---|---|
ProductAddressableLoader | The addressable loader. |
currentProduct
Current product.
Declaration
public Product currentProduct { get; }
Property Value
Type | Description |
---|---|
Product | The current product. |
currentProductIndex
Gets the index of the current product.
Declaration
public int currentProductIndex { get; }
Property Value
Type | Description |
---|---|
Int32 | The index of the current product. |
CurrentProductReference
Gets the current product reference.
Declaration
public AssetProductReference CurrentProductReference { get; }
Property Value
Type | Description |
---|---|
AssetProductReference | The current product reference. |
IsLoading
Gets a value indicating whether this instance is loading.
Declaration
public bool IsLoading { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
sceneCacheLoader
Gets the scene cache loader.
Declaration
public ProductSceneCacheLoader sceneCacheLoader { get; }
Property Value
Type | Description |
---|---|
ProductSceneCacheLoader | The scene cache loader. |
Methods
IsValidProductAsset(Configurator, Int32)
Determines whether [is valid product asset] [the specified configurator].
Declaration
public static bool IsValidProductAsset(Configurator configurator, int productIndex)
Parameters
Type | Name | Description |
---|---|---|
Configurator | configurator | The configurator. |
Int32 | productIndex | Index of the product. |
Returns
Type | Description |
---|---|
Boolean |
|
IsValidProductAsset(AssetProductReference)
Determines whether [is valid product asset] [the specified loadable product asset].
Declaration
public static bool IsValidProductAsset(AssetProductReference loadableProductAsset)
Parameters
Type | Name | Description |
---|---|---|
AssetProductReference | loadableProductAsset | The loadable product asset. |
Returns
Type | Description |
---|---|
Boolean |
|
LoadProduct(Int32, Configurator)
Loads the product.
Declaration
public AsyncOperationHandle<GameObject> LoadProduct(int index, Configurator configurator)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index. |
Configurator | configurator | The configurator. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<GameObject> | AsyncOperationHandle<GameObject>. |
ResetProductPosition()
Resets the product position.
Declaration
[Obsolete("This method has been moved to the Product class. Please use ResetProductPosition on the product directly instead.")]
public void ResetProductPosition()
SetDefaultProductParent()
Set the default product's parent
Declaration
public void SetDefaultProductParent()
SetProductLocation(Transform)
Positions the current product's parent to the specified Transform
.
Declaration
public void SetProductLocation(Transform location)
Parameters
Type | Name | Description |
---|---|---|
Transform | location |
|
SetProductLocationParent(Transform)
Positions the current product under the specified Transform
.
Declaration
public void SetProductLocationParent(Transform location)
Parameters
Type | Name | Description |
---|---|---|
Transform | location |
|
UnloadCurrentProduct(ConfigurationManager)
Unloads the current product.
Declaration
public void UnloadCurrentProduct(ConfigurationManager configurationManager)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationManager | configurationManager | The configuration manager. |
UnloadCurrentProductCompletely()
Unloads the current product completely.
Declaration
public void UnloadCurrentProductCompletely()
Events
anyProductChanged
Occurs when [any product changed].
Declaration
public static event ProductChangedHandler anyProductChanged
Event Type
Type | Description |
---|---|
ProductChangedHandler |
productChanged
Raised when the product has changed (loaded or unloaded).
Declaration
public event ProductChangedHandler productChanged
Event Type
Type | Description |
---|---|
ProductChangedHandler |