Class ConfigurationManager
The configurator has two main functions:
Namespace: Unity.Industrial.Forma.Core.Configuring
Syntax
public class ConfigurationManager : MonoBehaviour
Properties
configurator
Configurator to which the configuration manager belongs (must be the parent in the hierarchy).
Declaration
public Configurator configurator { get; }
Property Value
| Type | Description | 
|---|---|
| Configurator | The configurator.  | 
currentConfiguration
Current configuration.
Declaration
public IReadOnlyConfiguration currentConfiguration { get; }
Property Value
| Type | Description | 
|---|---|
| IReadOnlyConfiguration | The current configuration.  | 
Remarks
The current configuration is not necessarily already applied. Use Switcher to apply a configuration.
currentConfigurationInternal
Gets the current configuration internal.
Declaration
public Configuration currentConfigurationInternal { get; }
Property Value
| Type | Description | 
|---|---|
| Configuration | The current configuration internal.  | 
currentProduct
Current product.
Declaration
public Product currentProduct { get; }
Property Value
| Type | Description | 
|---|---|
| Product | The current product.  | 
currentProductIndex
Current product index.
Declaration
public int currentProductIndex { get; }
Property Value
| Type | Description | 
|---|---|
| Int32 | The index of the current product.  | 
products
Gets the products.
Declaration
public ProductRepository products { get; }
Property Value
| Type | Description | 
|---|---|
| ProductRepository | The products.  | 
Methods
ApplyDefaultConfiguration()
Applies the default configuration.
Declaration
public void ApplyDefaultConfiguration()
ApplyVerifiedConfigurationChange(VerifiedConfigurationChange)
Applies the given verified configuration change to the current configuration and switches it in the variant table.
Declaration
public void ApplyVerifiedConfigurationChange(VerifiedConfigurationChange verifiedConfigurationChange)
Parameters
| Type | Name | Description | 
|---|---|---|
| VerifiedConfigurationChange | verifiedConfigurationChange | The verified configuration change.  | 
Awake()
Awakes this instance.
Declaration
public void Awake()
ChangeCurrentConfigurationFeatures(IEnumerable<Feature>, IEnumerable<Feature>)
Changes the current configuration's features selection.
Declaration
public void ChangeCurrentConfigurationFeatures(IEnumerable<Feature> selectedFeatures, IEnumerable<Feature> deselectedFeatures)
Parameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<Feature> | selectedFeatures | The features that we want to select in the current configuration  | 
| IEnumerable<Feature> | deselectedFeatures | The features that we want to unselect in the current configuration  | 
GetCurrentDefaultConfiguration()
Get the current configuration based on the current context.
Declaration
public Configuration GetCurrentDefaultConfiguration()
Returns
| Type | Description | 
|---|---|
| Configuration | Configuration.  | 
IsLoading()
Determines whether this instance is loading.
Declaration
public bool IsLoading()
Returns
| Type | Description | 
|---|---|
| Boolean | 
  | 
LoadProduct(Int32)
Loads the product.
Declaration
public AsyncOperationHandle<GameObject> LoadProduct(int index)
Parameters
| Type | Name | Description | 
|---|---|---|
| Int32 | index | The index.  | 
Returns
| Type | Description | 
|---|---|
| AsyncOperationHandle<GameObject> | AsyncOperationHandle<GameObject>.  | 
OnValidate()
Called when [validate].
Declaration
public void OnValidate()
ProcessConfigurationOperation(ProviderOperation<RuleEngineReply>, Action<RuleEngineReply>)
Processes the configuration operation.
Declaration
public void ProcessConfigurationOperation(ProviderOperation<RuleEngineReply> configChangeOperation, Action<RuleEngineReply> callback = null)
Parameters
| Type | Name | Description | 
|---|---|---|
| ProviderOperation<RuleEngineReply> | configChangeOperation | The configuration change operation.  | 
| Action<RuleEngineReply> | callback | The callback.  | 
ProcessConfigurationReply(RuleEngineReply, Action<RuleEngineReply>)
Processes the configuration reply.
Declaration
public void ProcessConfigurationReply(RuleEngineReply reply, Action<RuleEngineReply> callback = null)
Parameters
| Type | Name | Description | 
|---|---|---|
| RuleEngineReply | reply | The reply.  | 
| Action<RuleEngineReply> | callback | The callback.  | 
QueryConfigurationChangeValidity(ConfigurationChange)
Verifies a configuration change (asynchronously), the change is validated against the configuration which the configuration change references.
Declaration
public ProviderOperation<RuleEngineReply> QueryConfigurationChangeValidity(ConfigurationChange configurationChange)
Parameters
| Type | Name | Description | 
|---|---|---|
| ConfigurationChange | configurationChange | The configuration change.  | 
Returns
| Type | Description | 
|---|---|
| ProviderOperation<RuleEngineReply> | ProviderOperation<RuleEngineReply>.  | 
Remarks
This is an asynchronous call that returns a handle of type IAsyncOperation{RuleEngineReply}. For some implementations, it may be that the call is effectively synchronous and the handle already contains the result. Check if IAsyncOperation{T}.isDone is
true after calling
this method if this is the case.
QueryDefaultConfigurationValidity()
Verifies the default configuration belonging to the current context (asynchronously).
Declaration
public ProviderOperation<RuleEngineReply> QueryDefaultConfigurationValidity()
Returns
| Type | Description | 
|---|---|
| ProviderOperation<RuleEngineReply> | ProviderOperation<RuleEngineReply>.  | 
Remarks
This is an asynchronous call that returns a handle of type IAsyncOperation{RuleEngineReply}. For some implementations, it may be that the call is effectively synchronous and the handle already contains the result. Check if IAsyncOperation{T}.isDone is
true after calling
this method if this is the case.
SwitchProduct(Int32)
Unloads the current product (destroys it) and loads the product with the given index.
Declaration
public AsyncOperationHandle<GameObject> SwitchProduct(int index)
Parameters
| Type | Name | Description | 
|---|---|---|
| Int32 | index | The index.  | 
Returns
| Type | Description | 
|---|---|
| AsyncOperationHandle<GameObject> | AsyncOperationHandle<GameObject>.  | 
SwitchProductAndApplyDefaultConfiguration(Int32)
Unloads the current product (destroys it) and loads the product with the given index.
Declaration
public AsyncOperationHandle<GameObject> SwitchProductAndApplyDefaultConfiguration(int index)
Parameters
| Type | Name | Description | 
|---|---|---|
| Int32 | index | The index.  | 
Returns
| Type | Description | 
|---|---|
| AsyncOperationHandle<GameObject> | AsyncOperationHandle<GameObject>.  | 
UnloadCurrentProduct()
Unloads the current product.
Declaration
public void UnloadCurrentProduct()
Events
configurationApplied
Raised when a configuration change has been applied to the variant table and all assignments have been switched.
Declaration
public event ConfigurationAppliedHandler configurationApplied
Event Type
| Type | Description | 
|---|---|
| ConfigurationAppliedHandler |