Class Variant
A variant is a feature with assignments that have consequences on the state of the product (geometry visbility, materials, etc.).
Inherited Members
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
Namespace: UnityEngine.Industrial.Configuring.Core
Syntax
[Serializable]
[ExecuteInEditMode]
public sealed class Variant : Feature
Properties
assignments
List of assignments associated with this variant (read-only).
Declaration
public ReadOnlyCollection<Assignment> assignments { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<Assignment> | The assignments. |
Methods
AddAssignment(Assignment)
Adds the assignment.
Declaration
public void AddAssignment(Assignment assignment)
Parameters
Type | Name | Description |
---|---|---|
Assignment | assignment | The assignment. |
AddAssignment<T>()
Creates and adds a new assignment of the given type to the variant.
Declaration
public T AddAssignment<T>()
where T : Assignment
Returns
Type | Description |
---|---|
T | T. |
Type Parameters
Name | Description |
---|---|
T |
RemoveAssignment(Assignment, Boolean)
Removes the given assignment from this variant.
Declaration
public void RemoveAssignment(Assignment assigment, bool deleteAssignment = true)
Parameters
Type | Name | Description |
---|---|---|
Assignment | assigment | The assigment. |
Boolean | deleteAssignment | if set to |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Assignment must not be null. |
ArgumentException | The assignment is not part of the variant. |
Events
assignmentsChanged
Occurs when [assignments changed].
Declaration
public event Variant.VariantAssignmentsChangedHandler assignmentsChanged
Event Type
Type | Description |
---|---|
Variant.VariantAssignmentsChangedHandler |