Class Product
Class Product.
Inherited Members
Namespace: UnityEngine.Industrial.Configuring.Core
Syntax
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Product : MonoBehaviour
Fields
definition
The definition
Declaration
[SerializeField]
public ProductDefinition definition
Field Value
Type | Description |
---|---|
ProductDefinition |
model
The model
Declaration
[SerializeField]
public GameObject model
Field Value
Type | Description |
---|---|
GameObject |
modelSet
The model set
Declaration
[FormerlySerializedAs("modelAndQueries")]
[SerializeField]
public GameObject modelSet
Field Value
Type | Description |
---|---|
GameObject |
modelSetPrefab
The model set prefab
Declaration
[FormerlySerializedAs("modelAndQueriesPrefab")]
[SerializeField]
public GameObject modelSetPrefab
Field Value
Type | Description |
---|---|
GameObject |
ModelSetPrefabSuffix
The model set prefab suffix
Declaration
public const string ModelSetPrefabSuffix = " ModelSet"
Field Value
Type | Description |
---|---|
String |
ProductDefinitionSuffixWithFileExtension
The product definition suffix with file extension
Declaration
public const string ProductDefinitionSuffixWithFileExtension = " Product Definition.asset"
Field Value
Type | Description |
---|---|
String |
ProductPrefabSuffix
The product prefab suffix
Declaration
public const string ProductPrefabSuffix = " Product"
Field Value
Type | Description |
---|---|
String |
settings
We separate the product settings structurally from the product so that they can be made independent of the actual models. This allows the settings to be used as they own prefab, which gives flexibility and ease-of-use when re-using a similar variant table and other settings across many similar models.
Declaration
[SerializeField]
public ProductSettings settings
Field Value
Type | Description |
---|---|
ProductSettings |
SettingsSuffix
The settings suffix
Declaration
public const string SettingsSuffix = " Settings"
Field Value
Type | Description |
---|---|
String |
UnhandleQueriesPrefix
The unhandle queries prefix
Declaration
public const string UnhandleQueriesPrefix = "UH_"
Field Value
Type | Description |
---|---|
String |
Properties
contextCollection
Gets the context collection.
Declaration
public ContextCollection contextCollection { get; }
Property Value
Type | Description |
---|---|
ContextCollection | The context collection. |
defaults
Gets the defaults.
Declaration
public IReadOnlyDictionary<Context, Configuration> defaults { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<Context, Configuration> | The defaults. |
isDirty
Gets or sets a value indicating whether this instance is dirty.
Declaration
public bool isDirty { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
localPriceData
Gets the local price data.
Declaration
public ProductLocalPrice localPriceData { get; }
Property Value
Type | Description |
---|---|
ProductLocalPrice | The local price data. |
ModelSetComponent
Gets the model set component.
Declaration
public ModelSet ModelSetComponent { get; }
Property Value
Type | Description |
---|---|
ModelSet | The model set component. |
presets
Gets the presets.
Declaration
public ReadOnlyCollection<Configuration> presets { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<Configuration> | The presets. |
productBounds
Gets the product bounds.
Declaration
public Bounds productBounds { get; }
Property Value
Type | Description |
---|---|
Bounds | The product bounds. |
ProfileReference
Gets the profile reference.
Declaration
public ProductProfileReference ProfileReference { get; }
Property Value
Type | Description |
---|---|
ProductProfileReference | The profile reference. |
Queries
Gets the queries.
Declaration
public IEnumerable<QueryNode> Queries { get; }
Property Value
Type | Description |
---|---|
IEnumerable<QueryNode> | The queries. |
QueryContext
Gets the query context.
Declaration
public QueryContext QueryContext { get; }
Property Value
Type | Description |
---|---|
QueryContext | The query context. |
QueryResults
Gets the query results.
Declaration
public QueryResults QueryResults { get; }
Property Value
Type | Description |
---|---|
QueryResults | The query results. |
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 the spawn point.
Declaration
public Transform spawnPoint { get; }
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
Gets the variant table.
Declaration
public VariantTable variantTable { get; }
Property Value
Type | Description |
---|---|
VariantTable | The variant table. |
Methods
AddDefault(Context)
Adds the default.
Declaration
public Configuration AddDefault(Context context)
Parameters
Type | Name | Description |
---|---|---|
Context | context | The context. |
Returns
Type | Description |
---|---|
Configuration | Configuration. |
AddPreset()
Adds the preset.
Declaration
public Configuration AddPreset()
Returns
Type | Description |
---|---|
Configuration | Configuration. |
Awake()
Awakes this instance.
Declaration
public void Awake()
CenterSpawnPoint()
Centers the spawn point.
Declaration
[ContextMenu("Center Spawn Point")]
public void CenterSpawnPoint()
CreateSpawnPoint()
Creates the spawn point.
Declaration
public void CreateSpawnPoint()
EnsureModelExists(Transform)
The model is either the instantiated model prefab if there is one
Declaration
public void EnsureModelExists(Transform parent = null)
Parameters
Type | Name | Description |
---|---|---|
Transform | parent | The parent. |
ExecuteQueries()
Executes the queries.
Declaration
public void ExecuteQueries()
GetModelGameObjectTransform()
Gets the model game object transform.
Declaration
public Transform GetModelGameObjectTransform()
Returns
Type | Description |
---|---|
Transform | Transform. |
Init()
Initializes this instance.
Declaration
public void Init()
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 |
|
OnValidate()
Called when [validate].
Declaration
public void OnValidate()
RefreshProductBounds()
Refreshes the product bounds.
Declaration
public void RefreshProductBounds()
RemoveDefault(Context)
Removes the default.
Declaration
public void RemoveDefault(Context context)
Parameters
Type | Name | Description |
---|---|---|
Context | context | The context. |
RemovePreset(Configuration)
Removes the preset.
Declaration
public void RemovePreset(Configuration preset)
Parameters
Type | Name | Description |
---|---|---|
Configuration | preset | The preset. |
RevertModelPrefab()
Reverts the model prefab.
Declaration
[ContextMenu("Revert Model Prefab")]
public void RevertModelPrefab()
SetConfiguratorProfileResources(List<String>)
Sets the configurator profile resources.
Declaration
public void SetConfiguratorProfileResources(List<string> materialResources)
Parameters
Type | Name | Description |
---|---|---|
List<String> | materialResources | The material resources. |
SetQueryRoot()
Sets the query root.
Declaration
public void SetQueryRoot()
Events
anyProductChanged
Occurs when [any product changed].
Declaration
public static event Action<ProductChangeArgs> anyProductChanged
Event Type
Type | Description |
---|---|
Action<ProductChangeArgs> |
defaultsChanged
Called when a default has been added or removed.
Declaration
public event ProductDefaultsChangedHandler defaultsChanged
Event Type
Type | Description |
---|---|
ProductDefaultsChangedHandler |
presetsChanged
Called when a preset has been added or removed.
Declaration
public event ProductPresetsChangedHandler presetsChanged
Event Type
Type | Description |
---|---|
ProductPresetsChangedHandler |
productChanged
Called when any property has changed
Declaration
public event EventHandler productChanged
Event Type
Type | Description |
---|---|
EventHandler |