ISpaceService

Space Service

Interface

Service for interacting with the current space.

Properties

hasLikedSpace

Has the local user loved this space?

isSandbox

Are we currently in a sandbox space?

spacePackageVersion

Returns the version of the space package that is currently running. Only makes sense when the current space is a unity-based space. Does not currently work properly with SpaceTemplate based spaces.

Methods

EnableAvatarToAvatarCollisions(bool)

Enable or disable avatar to avatar collisions

OpenURL(string)

Open a URL in the user's default browser. On web, this will open the URL in a new tab. On mobile, this will open the URL in the default browser app. In VR, this will open the URL in the default browser app (popover on Oculus Quest)

Events

onSpaceLiked

Triggered when the user likes the space.

Examples

void LogIfInSandbox(string message)
{
// Only send logs while in sandbox to not spam players console
if (SpatialBridge.spaceService.isSandbox)
{
Debug.Log("[Spatial Game] " + message);
}
}
void LogIfInSandbox(string message)
{
// Only send logs while in sandbox to not spam players console
if (SpatialBridge.spaceService.isSandbox)
{
Debug.Log("[Spatial Game] " + message);
}
}