public class TeleportToSpace : MonoBehaviour
{
public SpatialTriggerEvent trigger;
public string spaceId;
void Start()
{
trigger.onEnterEvent += HandleTriggerEnter;
}
void OnDestroy()
{
trigger.onEnterEvent -= HandleTriggerEnter;
}
void HandleTriggerEnter()
{
SpatialBridge.spaceService.TeleportToSpace(spaceId, false);
}
}
public class TeleportToSpace : MonoBehaviour
{
public SpatialTriggerEvent trigger;
public string spaceId;
void Start()
{
trigger.onEnterEvent += HandleTriggerEnter;
}
void OnDestroy()
{
trigger.onEnterEvent -= HandleTriggerEnter;
}
void HandleTriggerEnter()
{
SpatialBridge.spaceService.TeleportToSpace(spaceId, false);
}
}