Class Configurator
The configurator is the top-level layer of the architecture, containing references to runtime components (ConfigurationManager, Switcher), the Product data core model, settings for choosing providers and staging settings shared by multiple products.
Inherited Members
Namespace: Unity.Industrial.Forma.Core
Syntax
[ExecuteInEditMode]
[MovedFrom(true, "UnityEngine.Industrial.Configuring.ConfiguratorRuntime", "Unity.Industrial.Configurator", null)]
public class Configurator : MonoBehaviour
Fields
ProductSpawnPointObjectName
The product spawn point object name
Declaration
public const string ProductSpawnPointObjectName = "Product Spawn Point"
Field Value
| Type | Description |
|---|---|
| String |
s_ConfiguratorInstance
The s configurator instance
Declaration
public static Configurator s_ConfiguratorInstance
Field Value
| Type | Description |
|---|---|
| Configurator |
Properties
ActiveProfile
Gets the active profile.
Declaration
public ConfiguratorProfile ActiveProfile { get; }
Property Value
| Type | Description |
|---|---|
| ConfiguratorProfile | The active profile. |
ActiveProfileReference
Gets or sets the active profile reference.
Declaration
public ConfiguratorProfileReference ActiveProfileReference { get; set; }
Property Value
| Type | Description |
|---|---|
| ConfiguratorProfileReference | The active profile reference. |
analyticsEngine
Gets the analytics engine.
Declaration
public IAnalyticsEngine analyticsEngine { get; }
Property Value
| Type | Description |
|---|---|
| IAnalyticsEngine | The analytics engine. |
configurationManager
Reference to the configuration manager.
Declaration
public ConfigurationManager configurationManager { get; }
Property Value
| Type | Description |
|---|---|
| ConfigurationManager | The configuration manager. |
currentContext
Current context.
Declaration
public Context currentContext { get; }
Property Value
| Type | Description |
|---|---|
| Context | The current context. |
CurrentLoadableProductPrefab
Gets the current loadable product prefab.
Declaration
public AssetProductReference CurrentLoadableProductPrefab { get; }
Property Value
| Type | Description |
|---|---|
| AssetProductReference | The current loadable product prefab. |
CurrentProduct
Gets the 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. |
CurrentScene
Gets the current scene.
Declaration
public StagingElement CurrentScene { get; }
Property Value
| Type | Description |
|---|---|
| StagingElement | The current scene. |
ExportProfiles
Gets the export profiles.
Declaration
public List<BuildProfile> ExportProfiles { get; }
Property Value
| Type | Description |
|---|---|
| List<BuildProfile> | The export profiles. |
firstContext
Gets the first context.
Declaration
public Context firstContext { get; }
Property Value
| Type | Description |
|---|---|
| Context | The first context. |
globalStagingSettings
Reference to the global StagingSettings
Declaration
public StagingSettings globalStagingSettings { get; }
Property Value
| Type | Description |
|---|---|
| StagingSettings | The global staging settings. |
infoEngine
Gets the information engine.
Declaration
public IInfoEngine infoEngine { get; }
Property Value
| Type | Description |
|---|---|
| IInfoEngine | The information engine. |
IsProductLoaded
Whether the configurator has finished loading the product. Returns true if there are no products in the configurator to load.
Declaration
public bool IsProductLoaded { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
pricingEngine
Gets the pricing engine.
Declaration
public IPricingEngine pricingEngine { get; }
Property Value
| Type | Description |
|---|---|
| IPricingEngine | The pricing engine. |
Products
Gets the products.
Declaration
public IEnumerable<AssetProductReference> Products { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<AssetProductReference> | The products. |
ProfileDefinition
Gets the profile definition.
Declaration
public ProfileDefinition ProfileDefinition { get; set; }
Property Value
| Type | Description |
|---|---|
| ProfileDefinition | The profile definition. |
ruleEngine
Reference to the rule engine (internal reference).
Declaration
public IRuleEngine ruleEngine { get; }
Property Value
| Type | Description |
|---|---|
| IRuleEngine | The rule engine. |
settings
Settings of this configurator.
Declaration
public ConfiguratorSettings settings { get; set; }
Property Value
| Type | Description |
|---|---|
| ConfiguratorSettings | The settings. |
SpawnPoint
Gets the spawn point.
Declaration
public GameObject SpawnPoint { get; }
Property Value
| Type | Description |
|---|---|
| GameObject | The spawn point. |
splashscreen
The splashscreen
Declaration
public Splashscreen splashscreen { get; set; }
Property Value
| Type | Description |
|---|---|
| Splashscreen |
stagingManager
Reference to the Staging Manager
Declaration
public StagingManager stagingManager { get; }
Property Value
| Type | Description |
|---|---|
| StagingManager | The staging manager. |
switcher
Reference switcher that carries out the actual switching on the model.
Declaration
public Switcher switcher { get; }
Property Value
| Type | Description |
|---|---|
| Switcher | The switcher. |
Methods
ChangeCurrentContext(String, String)
Change the current context of the configurator
Declaration
public void ChangeCurrentContext(string contextName, string contextOption)
Parameters
| Type | Name | Description |
|---|---|---|
| String | contextName | The context name |
| String | contextOption | The context's option |
CreateProductSpawnPoint()
Create a Product Spawn Point as a child of the Spawn Point. NOTE: ResetConfigurator() should have previously destroyed it
Declaration
public GameObject CreateProductSpawnPoint()
Returns
| Type | Description |
|---|---|
| GameObject | Game object |
CreateSplashScreen()
Creates the splash screen.
Declaration
public void CreateSplashScreen()
GetProductSpawnPoint()
Gets the product spawn point.
Declaration
public GameObject GetProductSpawnPoint()
Returns
| Type | Description |
|---|---|
| GameObject | GameObject. |
InitConfigurator()
Initializes the configurator.
Declaration
[Obsolete("Please use Configurator.InitConfigurator(Action initRuntimeUIAction) instead.")]
public Coroutine InitConfigurator()
Returns
| Type | Description |
|---|---|
| Coroutine | Coroutine. |
InitConfigurator(Action)
Initializes the configurator.
Declaration
public Coroutine InitConfigurator(Action initRuntimeUIAction)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | initRuntimeUIAction | The action that will be called to initialize the runtime UI |
Returns
| Type | Description |
|---|---|
| Coroutine | Coroutine. |
InstantiateProviders()
Instantiates the providers.
Declaration
public void InstantiateProviders()
IsSplashscreenDefined()
Determines whether [is splashscreen defined].
Declaration
public bool IsSplashscreenDefined()
Returns
| Type | Description |
|---|---|
| Boolean |
|
PostInit(Action)
Posts the initialize.
Declaration
public void PostInit(Action action)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | The action. |
ReloadProviders()
Reloads the providers.
Declaration
public void ReloadProviders()
RemoveProduct(Int32, Boolean)
Removes the product.
Declaration
public void RemoveProduct(int productIndex, bool unloadProduct = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | productIndex | Index of the product. |
| Boolean | unloadProduct | if set to |
ResetConfigurator()
Resets the configurator.
Declaration
public void ResetConfigurator()
ResetProductPosition()
Resets the product position.
Declaration
public void ResetProductPosition()
ResetProductSpawnPointLocation()
Resets the Transform of the Product Spawn Point to that of the default Transform.
Declaration
public void ResetProductSpawnPointLocation()
ResetSpawnPoint()
Resets the spawn point.
Declaration
[ContextMenu("Reset Spawn Point")]
public void ResetSpawnPoint()
SetContext(Context)
Sets the current context.
Declaration
public void SetContext(Context context)
Parameters
| Type | Name | Description |
|---|---|---|
| Context | context | The context. |
Remarks
The context must not be
null and must be part of
the context collection of the current product (which must be set).
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The context must not be null. |
| InvalidOperationException | There is no current product: cannot set context. |
| ArgumentException | The current product does not contain the context. |
TryUnloadCurrentProduct()
Tries the unload current product.
Declaration
public void TryUnloadCurrentProduct()
UnloadContext()
Unloads the context.
Declaration
public void UnloadContext()
UnloadCurrentProduct()
Unloads the current product.
Declaration
public void UnloadCurrentProduct()
ValidateStaging()
Validates the staging.
Declaration
[ContextMenu("Validate Staging")]
public void ValidateStaging()
Events
anyConfiguratorChanged
Occurs when [any configurator changed].
Declaration
public static event Action<ConfiguratorChangeArgs> anyConfiguratorChanged
Event Type
| Type | Description |
|---|---|
| Action<ConfiguratorChangeArgs> |
contextChanged
Raised when the context of the product has been changed.
Declaration
public event ConfiguratorContextChangedHandler contextChanged
Event Type
| Type | Description |
|---|---|
| ConfiguratorContextChangedHandler |
settingsChanged
Occurs when [settings changed].
Declaration
public event SettingsChanged settingsChanged
Event Type
| Type | Description |
|---|---|
| SettingsChanged |