ドキュメント

サポート

Vivox Unity SDK

Vivox Unity SDK

チャンネルから退出する

How to remove a player from a Vivox channel and disconnect from communication.
読み終わるまでの所要時間 1 分最終更新 23日前

チャンネルからユーザーを削除するには、退出するチャンネルの名前で
VivoxService.Instance.LeaveChannelAsync(string channelName)
を呼び出します。別の方法として、
VivoxService.Instance.LeaveAllChannelsAsync()
を使用して、そのユーザーが接続しているすべてのチャンネルから退出することもできます。切断されたチャンネルオブジェクトは、切断が成功するまでの間、
VivoxService.Instance.ActiveChannels
リストに残ります。
セッションが完全に切断されている場合、オブジェクトはリストから即座に削除されます。 以下のコードは、この操作の実行方法の例を示します。
using UnityEngine;using Unity.Services.Vivox;class VivoxBasicsExample : MonoBehaviour{ . . . void LeaveChannel(string channelNameToLeave) { . . . VivoxService.Instance.LeaveChannelAsync(channelNameToLeave); . . . } . . .}