Class Pack
A pack contains other features that are activated when the pack is activated.
Inherited Members
Namespace: UnityEngine.Industrial.Configuring.Core
Syntax
[Serializable]
[ExecuteInEditMode]
public sealed class Pack : Feature
Properties
features
List of features in this pack (read-only).
Declaration
public ReadOnlyCollection<Feature> features { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<Feature> | The features. |
variantTable
Variant table containing this Pack.
Declaration
public VariantTable variantTable { get; }
Property Value
Type | Description |
---|---|
VariantTable | The variant table. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The pack is not part of a variant table: his FeatureSet is not the child of a game object with a VariantTable component. |
Methods
AddFeature(Feature)
Adds a feature to the pack (which must not already exist in the pack).
Declaration
public void AddFeature(Feature feature)
Parameters
Type | Name | Description |
---|---|---|
Feature | feature | The feature. |
Remarks
If the added feature is a pack, it is only checked if it is not this pack. No checks for longer cycles are done.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Feature must not be null. |
ArgumentException | The added feature is this pack: a pack cannot contain itself. |
ArgumentException | The feature is already in the pack. |
ArgumentException | Feature must not be null. |
ArgumentException | The added feature is this pack: a pack cannot contain itself. |
CheckForCycle()
Checks for a cycle in which the pack may be part.
Declaration
public IEnumerable<Pack> CheckForCycle()
Returns
Type | Description |
---|---|
IEnumerable<Pack> | Returns if the pack is not part of a cycle,
or the list of features that cause the cycle.
|
Remarks
The methods carries out a depth-first search from this pack and returns any cycle that is finds on the way. This pack may be part of this cycle or not.
RemoveFeature(Feature)
Removes a feature from the pack.
Declaration
public void RemoveFeature(Feature feature)
Parameters
Type | Name | Description |
---|---|---|
Feature | feature | The feature. |
Remarks
The feature must not be null and must be part of the pack; otherwise a ArgumentException is thrown.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Feature must not be null. |
ArgumentException | The feature is not part of the pack. |
Events
packChanged
Occurs when [pack changed].
Declaration
public event PackChangedHandler packChanged
Event Type
Type | Description |
---|---|
PackChangedHandler |