OnSessionCreateFailed
: readonly UnityEvent< string > |
Event to notify when failed to create and advertise the colocation session.
string: failure reason, could be potentially used to display instruction to users
Signature
readonly UnityEvent<string> OnSessionCreateFailed |
OnSessionCreateSucceeded
: readonly UnityEvent< Guid > |
Event to notify when a colocation session has been created and advertised successfully by the host.
Guid: group uuid that can be used to share anchors via OVRSpatialAnchor.ShareAsync
Signature
readonly UnityEvent<Guid> OnSessionCreateSucceeded |
OnSessionDiscoverFailed
: readonly UnityEvent< string > |
Event to notify when failed to discover the colocation session.
string: failure reason, could be potentially used to display instruction to users
Signature
readonly UnityEvent<string> OnSessionDiscoverFailed |
OnSessionDiscoverSucceeded
: readonly UnityEvent< Guid > |
Event to notify when a colocation session has been discovered successfully by the guest.
Guid: group uuid that can be used to retrieve anchors via OVRSpatialAnchor.LoadUnboundSharedAnchorsAsync
Signature
readonly UnityEvent<Guid> OnSessionDiscoverSucceeded |
StartAsGuest
(
stopAfterTimeout
)
|
Manually start as guest, this will discover colocation sessions via the OVRColocationSession API, then stop after timeDiscoveringInSec if setting stopAfterTimeout is set to true.
Signature
async Task StartAsGuest(bool stopAfterTimeout=true) Parameters stopAfterTimeout: boolÂ
Boolean to determine whether to automatically stop the discovery after timeDiscoveringInSec
Returns async Task |
StartAsHost
()
|
Manually start as host, this will create a networked room under the hood by CustomMatchmaking, and in turn this class listens for the networked room creation event then broadcast the room information via the OVRColocationSession API.
Signature
async Task StartAsHost() Returns async Task |
StartAdvertisingColocationSession
(
data
)
|
Wraps around the OVRColocationSession function to start advertise the colocation session with the byte data.
The public events of OnSessionCreateSucceeded and OnSessionCreateFailed will be notified accordingly.
Signature
static async void StartAdvertisingColocationSession(byte[] data) Parameters data: byte[]Â
metadata that's included in the advertisement, could pass up to OVRColocationSession.Data.MaxMetadataSize bytes.
Returns async void |
StartDiscoveringColocationSessions
(
onGroupFound
)
|
Wraps around the OVRColocationSession function to start discovering local sessions with custom callback.
The public events of OnSessionDiscoverSucceeded and OnSessionDiscoverFailed will be notified accordingly.
Signature
static async void StartDiscoveringColocationSessions(Action< OVRColocationSession.Data > onGroupFound) Parameters onGroupFound: Action< OVRColocationSession.Data >Â
Custom callback to parse the data received from the local session advertisement.
Returns async void |
StopAdvertisingColocationSession
()
|
Wraps around the OVRColocationSession function to stop advertise the local session.
Signature
static async void StopAdvertisingColocationSession() Returns async void |
StopDiscoveringColocationSessions
(
onGroupFound
)
|
Wraps around the OVRColocationSession function to stop discovering the local session.
Signature
static async void StopDiscoveringColocationSessions(Action< OVRColocationSession.Data > onGroupFound) Parameters onGroupFound: Action< OVRColocationSession.Data >Â
Custom callback to remove from the discovery subscription.
Returns async void |