docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class FeatureExtensions

    Extension methods for Feature flags.

    Inheritance
    object
    FeatureExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public static class FeatureExtensions

    Methods

    All(Feature, Feature)

    Tests whether all the features in features are present in self.

    Declaration
    public static bool All(this Feature self, Feature features)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature features

    The Features to test against.

    Returns
    Type Description
    bool

    true if all the features in features are also in self, otherwise false.

    Any(Feature, Feature)

    Tests whether any of the features in features are present in self.

    Declaration
    public static bool Any(this Feature self, Feature features)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature features

    The Features to test against.

    Returns
    Type Description
    bool

    true if any of the features in features are also in self, otherwise false.

    Cameras(Feature)

    Filters just the camera-related Feature flags.

    Declaration
    public static Feature Cameras(this Feature self)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Returns
    Type Description
    Feature

    The camera-related Feature flags from self.

    See Also
    AnyCamera

    Count(Feature)

    Calculates the number of enabled features in self.

    Declaration
    public static int Count(this Feature self)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Returns
    Type Description
    int

    The number of enabled Feature flags.

    Intersection(Feature, Feature)

    Computes the intersection of self and features (that is, the set of features present in both self and features).

    Declaration
    public static Feature Intersection(this Feature self, Feature features)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature features

    Features to intersect with self

    Returns
    Type Description
    Feature

    The intersection of self and features (that is, the set of features common to both self and features).

    LightEstimation(Feature)

    Filters just the light estimation related Feature flags.

    Declaration
    public static Feature LightEstimation(this Feature self)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Returns
    Type Description
    Feature

    The light estimation-related Feature flags from self.

    None(Feature, Feature)

    Tests whether there are any common features between self and features.

    Declaration
    public static bool None(this Feature self, Feature features)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature features

    The Features to test against.

    Returns
    Type Description
    bool

    true if none of the features in self are in features, otherwise false.

    SetDifference(Feature, Feature)

    Computes the set difference (that is, removes all flags in features from self).

    Declaration
    public static Feature SetDifference(this Feature self, Feature features)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature features

    Features to remove from self

    Returns
    Type Description
    Feature

    The set difference of self and features (that is, all members of self which do not belong to features).

    SetEnabled(Feature, Feature, bool)

    Sets or removes one or more Feature flags.

    Declaration
    public static Feature SetEnabled(this Feature self, Feature feature, bool enabled)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature feature

    The Feature(s) to set or remove.

    bool enabled

    If true, the flag(s) in feature will be set. If false, it/they will be removed.

    Returns
    Type Description
    Feature

    self with the Feature(s) set or removed according to the value of enabled.

    SymmetricDifference(Feature, Feature)

    Computes the symmetric difference (that is, the set of all features that belong to exactly one of self and features, present in one but not both).

    Declaration
    public static Feature SymmetricDifference(this Feature self, Feature features)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature features

    Features with which to compute the symmetric difference against self

    Returns
    Type Description
    Feature

    The symmetric difference of self and features (that is, the features that belong to self or features, but not both).

    ToStringList(Feature, string)

    Generates a single string representing the list of enabled features separated by separator, or a comma if not specified.

    Declaration
    public static string ToStringList(this Feature features, string separator = ", ")
    Parameters
    Type Name Description
    Feature features

    The Feature being extended.

    string separator

    The string separator to insert between elements of the list, or ", " if omitted.

    Returns
    Type Description
    string

    A string of Features separated by separator. If none of the features are enabled, returns "(None)".

    Remarks

    This method makes several heap allocations, generating garbage. It is intended for debugging purposes and should not be called frequently in a production application.

    TrackingModes(Feature)

    Filters just the tracking-related Feature flags.

    Declaration
    public static Feature TrackingModes(this Feature self)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Returns
    Type Description
    Feature

    The tracking-related Feature flags from self.

    See Also
    AnyTrackingMode

    Union(Feature, Feature)

    Computes the union of self and features (that is, the set of features in self or features or both).

    Declaration
    public static Feature Union(this Feature self, Feature features)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Feature features

    Features to union with self

    Returns
    Type Description
    Feature

    The union of self and features (that is, the set of features in self or features or both).

    WithoutCameraOrTracking(Feature)

    Removes all camera and tracking-related Feature flags.

    Declaration
    public static Feature WithoutCameraOrTracking(this Feature self)
    Parameters
    Type Name Description
    Feature self

    The Feature being extended.

    Returns
    Type Description
    Feature

    self with camera and tracking-related bits removed.

    See Also
    AnyCamera
    AnyTrackingMode
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)