if(!ShouldUpdateData(()=>{UpdatePlayerRelayInfoAsync(allocationId,onComplete);},onComplete,true))// Do retry here since the RelayUtpSetup that called this might be destroyed right after this.
if(!ShouldUpdateData(()=>{UpdatePlayerRelayInfoAsync(allocationId,connectionInfo,onComplete);},onComplete,true))// Do retry here since the RelayUtpSetup that called this might be destroyed right after this.
/// <param name="data">Key-value pairs, which will overwrite any existing data for these keys. Presumed to be available to all lobby members but not publicly.</param>
Debug.LogError("Relay returned a null Allocation. This might occur if the Relay service has an outage, if your cloud project ID isn't linked, or if your Relay package version is outdated.");
else
onComplete?.Invoke(response);
};
}
;
}
/// <summary>
Debug.LogError("Could not join async with Relay join code "+joinCode);
/// This observes the local player and updates remote players over Relay when there are local changes, demonstrating basic data transfer over the Unity Transport (UTP).
/// Created after the connection to Relay has been confirmed.
/// If you are using the Unity Networking Package, you can use their Relay instead of building your own packets.
/// </summary>
publicclassRelayUtpClient:MonoBehaviour,IDisposable// This is a MonoBehaviour merely to have access to Update.