OVRSpaceUser
(
spaceUserId
)
|
Creates a handle for a specific platform user in the current conceptual space.
This constructor does not perform any kind of validation. You should consider checking the Valid property after construction, or use the TryCreate(ulong,out OVRSpaceUser) static method instead.
Signature
OVRSpaceUser(ulong spaceUserId) Parameters spaceUserId: ulong
A user's unique ID provided by a support platform, i.e. the org-unique Oculus user ID. You must request these IDs e.g. from the Platform SDK. See also: Oculus.Platform.Users module. |
Id
: ulong
[Get] |
The org-unique Oculus user ID associated with this OVRSpaceUser.
This property is the spaceUserId argument provided to the OVRSpaceUser constructor, or zero if the OVRSpaceUser is not valid (Valid is false).
Signature
ulong Id |
Valid
: bool
[Get] |
Checks if this is a valid handle to an authenticated space user.
The OVRSpaceUser may be invalid if it has been disposed (Dispose) or if creation fails.
For example:
void Test(ulong platformUserId) {
if (OVRspaceUser.TryCreate(platformUserId, out var spaceUser)) {
Debug.Log(spaceUser.Valid); // True
spaceUser.Dispose();
Debug.Log(spaceUser.Valid); // False; spaceUser disposed
} else {
Debug.Log(spaceUser.Valid); // False; creation failed
}
}
Signature
bool Valid |
Dispose
()
|
Disposes of the OVRSpaceUser.
This method does not destroy the user account. It disposes the handle used to reference it.
Signature
void Dispose() Returns void |
TryCreate
(
platformUserId
, spaceUser
)
|
Tries to create a handle to a specific Oculus user in the current conceptual space.
platformUserId should not represent the numerical value 0. This is a common value to inadvertently obtain, usually in cases involving insufficient app, user, or device permissions.
Signature
static bool TryCreate(ulong platformUserId, out OVRSpaceUser spaceUser) Parameters platformUserId: ulong
A user's unique ID provided by a support platform, i.e. the org-unique Oculus user ID. You must request these IDs e.g. from the Platform SDK. See also: Oculus.Platform.Users module. spaceUser: out OVRSpaceUser
The result of the space user creation request; will only be Valid iff this method returned true.
|
TryCreate
(
platformUserId
, spaceUser
)
|
Tries to create a handle to a specific Oculus user in the current conceptual space.
platformUserId should not represent the numerical value 0. This is a common value to inadvertently obtain, usually in cases involving insufficient app, user, or device permissions.
Signature
static bool TryCreate(string platformUserId, out OVRSpaceUser spaceUser) Parameters platformUserId: string
A user's unique ID provided by a support platform, i.e. the org-unique Oculus user ID. You must request these IDs e.g. from the Platform SDK. See also: Oculus.Platform.Users module. spaceUser: out OVRSpaceUser
The result of the space user creation request; will only be Valid iff this method returned true.
Returns bool true if spaceUser is a valid handle to a user in the current space. false may be returned if platformUserId is null or could not be parsed as a numerical ID.
|