チャンネルから退出する
How to remove a player from a Vivox channel and disconnect from communication.
読み終わるまでの所要時間 1 分最終更新 7ヶ月前
チャンネルからユーザーを削除するには、退出するチャンネルの名前で を呼び出します。別の方法として、 を使用して、そのユーザーが接続しているすべてのチャンネルから退出することもできます。切断されたチャンネルオブジェクトは、切断が成功するまでの間、 リストに残ります。
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); . . . } . . .}