ID
: int
[Get] |
The numerical identifier associated with this UniqueIdentifier.
This number is guaranteed to be unique at any given time within an instance of an application.
"Unique at any given time" means there is never more than one valid UniqueIdentifier with the same ID at the same time within an instance of an application. However, different UniqueIdentifiers may have the same numerical ID if they do not exist at the same time as long as Release(UniqueIdentifier) has been called on the earlier instance before Generate produces the later.
This number is often used in place of the UniqueIdentifier itself; for example, IInteractorView.Identifier and the PointerEvent.Identifiers which refer to it both leveral the numerical value of the interactor's underlying UniqueIdentifier.ID.
Signature
int Oculus.Interaction.UniqueIdentifier.ID |
Generate
()
|
Creates a new UniqueIdentifier with a numerical ID which is guaranteed to be unique in the application for the lifespan of the new UniqueIdentifier (i.e., until Release(UniqueIdentifier) is called upon it).
Signature
static UniqueIdentifier Oculus.Interaction.UniqueIdentifier.Generate() |
Generate
(
context
, instance
)
|
Creates a new UniqueIdentifier with a numerical ID which is guaranteed to be unique in the application for the lifespan of the new UniqueIdentifier (i.e., until Release(UniqueIdentifier) is called upon it).
Associates that identifier with the provided instance for future retrieval via TryGetInstanceFromIdentifier(Context, int, out object).
Signature
static UniqueIdentifier Oculus.Interaction.UniqueIdentifier.Generate(Context context, object instance) Parameters instance: object
The instance associated with the new identifier
|
GetInstanceFromIdentifierAsync
(
context
, identifier
)
|
Attempts to retrieve the instance associated with the provided identifier in the provided context .
Signature
static Task<object> Oculus.Interaction.UniqueIdentifier.GetInstanceFromIdentifierAsync(Context context, int identifier) Parameters Returns Task< object >
A task returning the associated instance, if one exists
|
Release
(
identifier
)
|
Invalidates a UniqueIdentifier and returns its ID to the space of allowable IDs for new UniqueIdentifiers.
Any further use of the identifier after release is unsupported and can cause undefined behavior.
Signature
static void Oculus.Interaction.UniqueIdentifier.Release(UniqueIdentifier identifier) Parameters Returns void |
TryGetInstanceFromIdentifier
(
context
, identifier
, instance
)
|
Attempts to retrieve the instance associated with the provided identifier in the given context .
Signature
static bool Oculus.Interaction.UniqueIdentifier.TryGetInstanceFromIdentifier(Context context, int identifier, out object instance) Parameters instance: out object
Out parameter, the discovered associated instance, if one exists
Returns bool
True if the instance was found, false otherwise
|