Class ProductSettings
The product is the entry point for all components relevant to product. The Product class contains information about a single configurable product: identifiers (an internal ID, and/or the product name); the collection of contexts in which the product is available; a list of initial/default configurations for this product; the Variant Table, containing all possible variants; the local staging variants (environments, camera angles, etc.).
Inherited Members
Namespace: UnityEngine.Industrial.Configuring.Core
Syntax
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class ProductSettings : MonoBehaviour
Fields
forceSaveBeforePlayMode
The force save before play mode
Declaration
[SerializeField]
[HideInInspector]
public bool forceSaveBeforePlayMode
Field Value
Type | Description |
---|---|
Boolean |
isDirty
The is dirty
Declaration
[SerializeField]
[Tooltip("Whether this product needs to be saved or not.")]
public bool isDirty
Field Value
Type | Description |
---|---|
Boolean |
product
The product
Declaration
[HideInInspector]
[SerializeField]
public Product product
Field Value
Type | Description |
---|---|
Product |
settingsName
The settings name
Declaration
public const string settingsName = "settings"
Field Value
Type | Description |
---|---|
String |
Properties
contextCollection
Context collection belonging to this product.
Declaration
public ContextCollection contextCollection { get; }
Property Value
Type | Description |
---|---|
ContextCollection | The context collection. |
defaults
Default configurations: each context can have a default configuration that is used as the basis before switching the model. Default configurations represent the initial state of a product for a given context. Normally, users do not select every single variant of a product, especially at the beginning of the configuration: in most cases, they only broadly select the product line and they can already see an initial, default configuration. The configuration workflow then builds upon this initial, default configuration
Declaration
public IReadOnlyDictionary<Context, Configuration> defaults { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<Context, Configuration> | The defaults. |
localPriceData
Gets the local price data.
Declaration
public ProductLocalPrice localPriceData { get; }
Property Value
Type | Description |
---|---|
ProductLocalPrice | The local price data. |
presets
Preset configurations for this product.
Declaration
public ReadOnlyCollection<Configuration> presets { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<Configuration> | The presets. |
rules
Gets the rules.
Declaration
public Rules rules { get; }
Property Value
Type | Description |
---|---|
Rules | The rules. |
runtimeUIData
Gets the runtime UI data.
Declaration
public ProductRuntimeUIData runtimeUIData { get; }
Property Value
Type | Description |
---|---|
ProductRuntimeUIData | The runtime UI data. |
spawnPoint
Gets or sets the spawn point.
Declaration
public Transform spawnPoint { get; set; }
Property Value
Type | Description |
---|---|
Transform | The spawn point. |
stagingSettings
Gets the staging settings.
Declaration
public StagingSettings stagingSettings { get; }
Property Value
Type | Description |
---|---|
StagingSettings | The staging settings. |
variantTable
Variant table belonging to this product.
Declaration
public VariantTable variantTable { get; }
Property Value
Type | Description |
---|---|
VariantTable | The variant table. |
Methods
AddDefault(Context)
Adds a default configuration to the set of defaults.
Declaration
public Configuration AddDefault(Context context)
Parameters
Type | Name | Description |
---|---|---|
Context | context | The context. |
Returns
Type | Description |
---|---|
Configuration | Creates a new (blank) configuration that is the default for this context. |
Remarks
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The context must not be null. |
ArgumentException | The context is not part of the context collection. |
AddPreset()
Creates and adds a new preset configuration.
Declaration
public Configuration AddPreset()
Returns
Type | Description |
---|---|
Configuration | Configuration. |
Awake()
Awakes this instance.
Declaration
public void Awake()
CreateSpawnPoint()
Creates the spawn point.
Declaration
public void CreateSpawnPoint()
IsConfiguratorHiddenObject(GameObject)
Determines whether [is configurator hidden object] [the specified object].
Declaration
public bool IsConfiguratorHiddenObject(GameObject obj)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object. |
Returns
Type | Description |
---|---|
Boolean |
|
OnDisable()
Called when [disable].
Declaration
public void OnDisable()
OnEnable()
Called when [enable].
Declaration
public void OnEnable()
OnValidate()
Called when [validate].
Declaration
public void OnValidate()
RemoveDefault(Context)
Remove a default configuration from the set of defaults.
Declaration
public void RemoveDefault(Context context)
Parameters
Type | Name | Description |
---|---|---|
Context | context | The context. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The context must not be null. |
ArgumentException | The context is not part of the context collection. |
RemovePreset(Configuration)
Removes the configuration from the presets and destroys it.
Declaration
public void RemovePreset(Configuration preset)
Parameters
Type | Name | Description |
---|---|---|
Configuration | preset | The preset. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The preset cannot be null. |
ArgumentException | The configuration is not a preset of this product. |