Struct XRReferenceObject
Represents a 3D scan of a real object that can be recognized in the environment.
Inherited Members
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.
Constructors
XRReferenceObject(String)
Creates a new reference object. This is most commonly used to construct a new reference object at runtime. See Add(XRReferenceObject)
Declaration
public XRReferenceObject(string name)
Parameters
| Type | Name | Description | 
|---|---|---|
| String | name | The name of the new reference object.  | 
Properties
guid
A GUID unique to this reference object.
Declaration
public readonly Guid guid { get; }
Property Value
| Type | Description | 
|---|---|
| Guid | 
name
A string name for this reference object.
Declaration
public readonly string name { get; }
Property Value
| Type | Description | 
|---|---|
| String | 
Methods
AddEntry(XRReferenceObjectEntry)
Adds a provider-specific entry to this reference object.
Declaration
public void AddEntry(XRReferenceObjectEntry entry)
Parameters
| Type | Name | Description | 
|---|---|---|
| XRReferenceObjectEntry | entry | The entry to add.  | 
Exceptions
| Type | Condition | 
|---|---|
| ArgumentException | Thrown if an entry of the same type as   | 
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 | 
  | 
Implements
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 | 
  |