Struct XRResultStatus
This struct uses an integer to represent the status of a completed operation.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: solution.dll
Syntax
public struct XRResultStatus : IEquatable<XRResultStatus>, IComparable<XRResultStatus>
Constructors
XRResultStatus(bool)
Construct an instance from a boolean value.
Declaration
public XRResultStatus(bool wasSuccessful)
Parameters
Type | Name | Description |
---|---|---|
bool | wasSuccessful |
XRResultStatus(int)
Construct an instance with a given integer value.
Declaration
public XRResultStatus(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | The integer value. |
Properties
value
Get the integer value of this struct. The integer value has these meanings:
Value | Meaning |
---|---|
Less than zero | The operation failed with an error. |
Zero | The operation was an unqualified success. |
Greater than zero | The operation succeeded but additional status information is available. |
Declaration
public int value { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Platforms may assign integer values to specific error codes and success codes associated with that platform. Refer to the provider plug-in documentation for your target platform(s) to further understand how to interpret this integer value on each platform.
Methods
CompareTo(XRResultStatus)
Compares the current instance with another object of the same type and returns an integer that indicates
whether the current instance precedes, follows, or occurs in the same position in the sort order as the
other object. XRResultStatus
objects are sorted by their value.
Declaration
public int CompareTo(XRResultStatus other)
Parameters
Type | Name | Description |
---|---|---|
XRResultStatus | other | An object to compare with this instance. |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
int | A value that indicates the relative order of the objects being compared. The return value has these meanings:
|
Equals(XRResultStatus)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(XRResultStatus other)
Parameters
Type | Name | Description |
---|---|---|
XRResultStatus | other | The other object. |
Returns
Type | Description |
---|---|
bool |
IsError()
Indicates whether the operation failed with an error.
Declaration
public bool IsError()
Returns
Type | Description |
---|---|
bool |
Remarks
Equivalent to !IsSuccess()
.
IsSuccess()
Indicates whether the operation was successful, inclusive of all success codes. If value is greater than 0, additional status information may be available. Refer to your provider plug-in documentation for more information about the possible success codes on that platform.
Declaration
public bool IsSuccess()
Returns
Type | Description |
---|---|
bool |
Remarks
Equivalent to both !IsError()
and implicitly converting this instance to bool.
IsUnqualifiedSuccess()
Indicates whether the operation was an unqualified success. In other words, returns true if the operation succeeded and no additional status information is available.
Declaration
public bool IsUnqualifiedSuccess()
Returns
Type | Description |
---|---|
bool | true if the operation was an unqualified success. Otherwise, false. |
Operators
implicit operator XRResultStatus(bool)
Convert from bool to XRResultStatus
.
Declaration
public static implicit operator XRResultStatus(bool wasSuccessful)
Parameters
Type | Name | Description |
---|---|---|
bool | wasSuccessful | Whether the operation was successful. |
Returns
Type | Description |
---|---|
XRResultStatus | The status. |
implicit operator XRResultStatus(int)
Convert from int to XRResultStatus
.
Declaration
public static implicit operator XRResultStatus(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | The integer value. |
Returns
Type | Description |
---|---|
XRResultStatus | The status. |
implicit operator bool(XRResultStatus)
Convert from XRResultStatus
to bool.
Declaration
public static implicit operator bool(XRResultStatus status)
Parameters
Type | Name | Description |
---|---|---|
XRResultStatus | status | The status. |
Returns
Type | Description |
---|---|
bool |
implicit operator int(XRResultStatus)
Convert from XRResultStatus
to int.
Declaration
public static implicit operator int(XRResultStatus status)
Parameters
Type | Name | Description |
---|---|---|
XRResultStatus | status | The status. |
Returns
Type | Description |
---|---|
int | The integer value. |