Class XRReferenceObjectLibraryExtensions
Editor extensions to the XRReferenceObjectLibrary.
Inherited Members
Namespace: UnityEditor.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.Editor.dll
Syntax
public static class XRReferenceObjectLibraryExtensions
Methods
Add(XRReferenceObjectLibrary)
Creates a new XRReferenceObject and adds it to the library.
Declaration
public static int Add(this XRReferenceObjectLibrary library)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceObjectLibrary | library | The |
Returns
| Type | Description |
|---|---|
| int | The index in the library at which the new reference object was created. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
RemoveAt(XRReferenceObjectLibrary, int)
Removes the XRReferenceObject at index.
Declaration
public static void RemoveAt(this XRReferenceObjectLibrary library, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceObjectLibrary | library | The |
| int | index | The index of the |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
| IndexOutOfRangeException | Thrown if |
SetReferenceObjectEntry(XRReferenceObjectLibrary, int, Type, XRReferenceObjectEntry)
Sets the entry for the given type of the XRReferenceObject at index index.
Declaration
public static void SetReferenceObjectEntry(this XRReferenceObjectLibrary library, int index, Type type, XRReferenceObjectEntry entry)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceObjectLibrary | library | The |
| int | index | The index of the |
| Type | type | The type of the XRReferenceObjectEntry being set. |
| XRReferenceObjectEntry | entry | The entry to use for the given |
Remarks
Each reference object contains a list of "entries", one for each provider (implementation of XRObjectTrackingSubsystem).
This method sets the entry for a given type, which is the data that will be used when that provider is active.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
| ArgumentNullException | Thrown if |
| IndexOutOfRangeException | Thrown if |
| ArgumentException | Thrown if |
SetReferenceObjectName(XRReferenceObjectLibrary, int, string)
Sets the name of the XRReferenceObject at index.
Declaration
public static void SetReferenceObjectName(this XRReferenceObjectLibrary library, int index, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceObjectLibrary | library | The |
| int | index | The index of the |
| string | name | The new name of the |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
| IndexOutOfRangeException | Thrown if |