Class FeatureExtensions
Extension methods for Feature flags.
Inherited Members
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 |
|
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 |
|
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 |
See Also
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 |
Returns
Type | Description |
---|---|
Feature | The intersection of |
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 |
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 |
|
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 |
Returns
Type | Description |
---|---|
Feature | The set difference of |
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 |
Returns
Type | Description |
---|---|
Feature |
|
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 |
Returns
Type | Description |
---|---|
Feature | The symmetric difference of |
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 |
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 |
See Also
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 |
Returns
Type | Description |
---|---|
Feature | The union of |
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 |
|