Struct XRReferenceObject
Represents a 3D scan of a real object that can be recognized in the environment.
Namespace: UnityEngine.XR.ARSubsystems
Syntax
[Serializable]
public struct XRReferenceObject : IEquatable<XRReferenceObject>
Remarks
Reference objects contain a list of provider-specific "entries". Each "entry" must have previously been generated in a format specific to its implementation of the XRObjectTrackingSubsystem.
Properties
guid
A Guid unique to this reference object.
Declaration
public Guid guid { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
name
A string name for this reference object.
Declaration
public string name { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
Equals(Object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Overrides
Equals(XRReferenceObject)
Tests for equality.
Declaration
public bool Equals(XRReferenceObject other)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceObject | other | The other XRReferenceObject to compare against. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
FindEntry(Type)
Finds an XRReferenceObjectEntry by type.
Declaration
public XRReferenceObjectEntry FindEntry(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The specific type of XRReferenceObjectEntry to find. |
Returns
| Type | Description |
|---|---|
| XRReferenceObjectEntry | The provider-specific XRReferenceObjectEntry if found, otherwise |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
See Also
FindEntry<T>()
Finds an XRReferenceObjectEntry by type.
Declaration
public T FindEntry<T>()
where T : XRReferenceObjectEntry
Returns
| Type | Description |
|---|---|
| T | The provider-specific XRReferenceObjectEntry if found, otherwise |
Type Parameters
| Name | Description |
|---|---|
| T | The specific type of XRReferenceObjectEntry to find. |
See Also
GetHashCode()
Generates a hash suitable for use with containers like HashSet and Dictionary.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | A hash code generated from this object's fields. |
Overrides
Operators
Equality(XRReferenceObject, XRReferenceObject)
Tests for equality. Same as Equals(XRReferenceObject).
Declaration
public static bool operator ==(XRReferenceObject lhs, XRReferenceObject rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceObject | lhs | The left-hand side of the comparison. |
| XRReferenceObject | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Inequality(XRReferenceObject, XRReferenceObject)
Tests for inequality. Same as !Equals(XRReferenceObject).
Declaration
public static bool operator !=(XRReferenceObject lhs, XRReferenceObject rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceObject | lhs | The left-hand side of the comparison. |
| XRReferenceObject | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| Boolean |
|