docs.unity3d.com
    Show / Hide Table of Contents

    Class FeatureSet<T>

    Generic version of FeatureSet where the generic type is the type of the feature.

    Inheritance
    Object
    FeatureSet
    FeatureSet<T>
    PackSet
    VariantSet
    Inherited Members
    FeatureSet.featureSetChanged
    FeatureSet.globalFeatureSetChangedHandler
    FeatureSet.code
    FeatureSet._thumbnailCameraHolder
    FeatureSet.ThumbnailCameraHolder
    FeatureSet._thumbnailCamera
    FeatureSet.ThumbnailCamera
    FeatureSet.RaiseFeatureSetChanged(Object, FeatureSetChangedArgs)
    FeatureSet.OnValidate()
    Namespace: Unity.Industrial.Forma.Core.Variants
    Syntax
    public class FeatureSet<T> : FeatureSet, ISerializationCallbackReceiver where T : Feature
    Type Parameters
    Name Description
    T

    Fields

    m_DefaultFeature

    The default feature

    Declaration
    protected T m_DefaultFeature
    Field Value
    Type Description
    T

    m_FeatureForCode

    The feature for code

    Declaration
    protected Dictionary<string, T> m_FeatureForCode
    Field Value
    Type Description
    Dictionary<String, T>

    m_Features

    The features

    Declaration
    protected List<T> m_Features
    Field Value
    Type Description
    List<T>

    m_SelectedFeature

    The selected feature

    Declaration
    protected T m_SelectedFeature
    Field Value
    Type Description
    T

    Properties

    codes

    Read-only collection of codes of the features in this set.

    Declaration
    public override IReadOnlyList<string> codes { get; }
    Property Value
    Type Description
    IReadOnlyList<String>

    The codes.

    Overrides
    FeatureSet.codes

    defaultFeature

    Gets the default feature.

    Declaration
    public T defaultFeature { get; }
    Property Value
    Type Description
    T

    The default feature.

    featureForCode

    Mapping from codes to features (read-only).

    Declaration
    public IReadOnlyDictionary<string, T> featureForCode { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<String, T>

    The feature for code.

    features

    List of features in this feature set (read-only).

    Declaration
    public IReadOnlyList<T> features { get; }
    Property Value
    Type Description
    IReadOnlyList<T>

    The features.

    selectedFeature

    Currently selected feature.

    Declaration
    public T selectedFeature { get; }
    Property Value
    Type Description
    T

    The selected feature.

    Remarks

    Use SelectFeature(T) for selecting a feature.

    variantTable

    Variant table containing this feature set.

    Declaration
    public VariantTable variantTable { get; }
    Property Value
    Type Description
    VariantTable

    The variant table.

    Methods

    AddFeature(String)

    Adds a new feature of the given code to the feature set.

    Declaration
    public virtual T AddFeature(string featureCode)
    Parameters
    Type Name Description
    String featureCode

    The feature code.

    Returns
    Type Description
    T

    T.

    Remarks

    Throws if

    code
    is null or only whitespaces, or if there is already a variant of the given code in the set.

    DeselectFeature()

    Deselects the feature.

    Declaration
    public override void DeselectFeature()
    Overrides
    FeatureSet.DeselectFeature()

    featureIndexOf(Feature)

    Index of feature in this feature set

    Declaration
    public override int featureIndexOf(Feature feature)
    Parameters
    Type Name Description
    Feature feature

    The feature.

    Returns
    Type Description
    Int32

    System.Int32.

    Overrides
    FeatureSet.featureIndexOf(Feature)

    GetFeatures()

    Gets the features.

    Declaration
    protected override IReadOnlyList<Feature> GetFeatures()
    Returns
    Type Description
    IReadOnlyList<Feature>

    IReadOnlyList<Feature>.

    Overrides
    FeatureSet.GetFeatures()

    GetSelectedFeature()

    Gets the selected feature.

    Declaration
    protected override Feature GetSelectedFeature()
    Returns
    Type Description
    Feature

    Feature.

    Overrides
    FeatureSet.GetSelectedFeature()

    HandleFeatureCodeChange(Object, FeatureCodeChangedEventArgs)

    Handles the feature code change.

    Declaration
    protected void HandleFeatureCodeChange(object sender, FeatureCodeChangedEventArgs args)
    Parameters
    Type Name Description
    Object sender

    The sender.

    FeatureCodeChangedEventArgs args

    The FeatureCodeChangedEventArgs instance containing the event data.

    HasFeature(Feature)

    Determines whether the specified feature has feature.

    Declaration
    public bool HasFeature(Feature feature)
    Parameters
    Type Name Description
    Feature feature

    The feature.

    Returns
    Type Description
    Boolean

    true if the specified feature has feature; otherwise, false.

    MoveFeature(T, Int32)

    Move the feature to index of the feature set

    Declaration
    public void MoveFeature(T feature, int index)
    Parameters
    Type Name Description
    T feature

    The feature.

    Int32 index

    The index.

    Remarks

    Throws an if input index is out of range.

    OnDisable()

    Called when [disable].

    Declaration
    protected void OnDisable()

    OnEnable()

    Called when [enable].

    Declaration
    protected void OnEnable()

    RemoveFeature(T)

    Removes the feature from the feature set (along with its assignments).

    Declaration
    public void RemoveFeature(T feature)
    Parameters
    Type Name Description
    T feature

    The feature.

    Remarks

    Throws an if the feature is not in the feature set.

    RemoveFeature(String)

    Removes the feature of the given code from the feature set (along with its assignments).

    Declaration
    public void RemoveFeature(string featureCode)
    Parameters
    Type Name Description
    String featureCode

    The feature code.

    Remarks

    Throws an if no feature of the given code is in the feature set.

    ResetSelection()

    Selects the first feature in the feature set.

    Declaration
    public override void ResetSelection()
    Overrides
    FeatureSet.ResetSelection()

    SelectFeature(T)

    Selects the passed feature, deselecting the previous feature.

    Declaration
    public void SelectFeature(T feature)
    Parameters
    Type Name Description
    T feature

    The feature.

    Remarks

    Throws an if the feature is

    null
    or not in the feature set.

    SelectFeatureInternal(T)

    Selects the feature internal.

    Declaration
    public void SelectFeatureInternal(T feature)
    Parameters
    Type Name Description
    T feature

    The feature.

    SetDefaultFeature()

    Sets the default feature.

    Declaration
    public void SetDefaultFeature()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023