AwaitAnySpaceConnection (Unity)
- Declaration
public static void AwaitAnySpaceConnection(Action<CavrnusSpaceConnection> onConnected)
- Description
Triggers immediately if you are already in a space, otherwise triggers as soon as you connect
- Sample
using CavrnusSdk.API;
using UnityEngine;
public class SpaceUiSpawner : MonoBehaviour
{
public GameObject SpaceMenuPrefab;
void Start()
{
CavrnusFunctionLibrary.AwaitAnySpaceConnection(spaceConn => GameObject.Instantiate(SpaceMenuPrefab));
}
}