채널 나가기
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); . . . } . . .}