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 package version of the Space package that is loaded. Otherwise, returns 0 if the version failed to parse or fetch.

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)

TeleportToSpace(string, bool)

Teleport user to a space.

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);
}
}