/
FetchJoinableSpaces (Unity)
FetchJoinableSpaces (Unity)
- Declaration
public static void FetchJoinableSpaces(Action<List<CavrnusSpaceInfo>> onRecvCurrentJoinableSpaces)
- Description
Gets a list of all current spaces which can be joined.
Note that this list will not update as new spaces are added, removed, or modified. To maintain those changes in your menu, consider instead using BindJoinableSpaces.
- Sample
using CavrnusSdk.API;
using UnityEngine;
public class FetchJoinableSpaces : MonoBehaviour
{
void Start()
{
CavrnusFunctionLibrary.AwaitAuthentication(auth => FetchMySpaces());
}
private void FetchMySpaces()
{
CavrnusFunctionLibrary.FetchJoinableSpaces(spaces =>
{
//Attempt to join the space named "DEMO"
foreach (var space in spaces)
{
if (space.Name == "DEMO")
{
CavrnusFunctionLibrary.JoinSpace(space.Id, spaceConn => { }, err => { });
return;
}
}
Debug.LogError("No available space named \"DEMO\"");
});
}
}
, multiple selections available,
Related content
FetchJoinableSpaces (.NET)
FetchJoinableSpaces (.NET)
More like this
JoinSpace (Unity)
JoinSpace (Unity)
More like this
JoinSpaceWithOptions (Unity)
JoinSpaceWithOptions (Unity)
More like this
BindJoinableSpaces (Unity)
BindJoinableSpaces (Unity)
More like this
BindJoinableSpaces (Unreal Engine)
BindJoinableSpaces (Unreal Engine)
More like this
AwaitAuthentication (Unity)
AwaitAuthentication (Unity)
More like this