RTCManager
Namespace: SynicSugar.RTC
Description
Manage around RTC on session.
This script is Mono's Singleton attached to NetworkManager. To generate NetworkManager, right-click on the Hierarchy and click SynicSugar/NetworkManager
NetworkManager has DontDestroy, so NetworkManager will not be destroyed by scene transitions.
Properity
| API | description |
|---|---|
| ParticipantUpdatedNotifier | Notification whether a member is speaking |
| IsVoiceChatEnabled | Indicates whether the current Lobby has VC enabled |
| IsLocalSendingEnabled | Indicates whether local sending is enabled |
| IsLocalReceivingEnabled | Indicates whether local receiving is enabled |
| VoiceChatMode | Voice chat mode of this Manager |
| KeyToPushToTalk | the key or keycode for PushToTalk |
| LastStateUpdatedUserId | ID of the user whose status was last updated |
Function
| API | description |
|---|---|
| StartVoiceSending | Starts local user sending voice chat |
| StopVoiceSending | Stop local user sending voice chat |
| ToggleLocalUserSending | Switch Input setting of Local user sending |
| ToggleReceiveingFromTarget | Switch Output setting(Enable or Mute) of receiving from target |
| UpdateReceiveingVolumeFromTarget | Change the receiving volume on this Session |
| HardMuteTargetUser | Host mutes target user('s input) |
| TargetOutputedVolumeOnLocal | Outputed volume on this local of target |
| TryGetTargetOutputedVolumeOnLocal | Outputed volume on this local of target |
| IsTargetMutedOnLocal | Target state is mute or not |
| TryGetIsTargetMutedOnLocal | Target state is mute or not |
| IsTargetHardMuted | Target state is hard mute or not |
| TryGetIsTargetHardMuted | Target state is hard mute or not |
using SynicSugar.P2P;
using SynicSugar.RTC;
using UnityEngine;
public class NetworkSample : MonoBehaviour {
void Start() {
//Start ReceivingVC on StartPacketReceiver().
RTCManager.Instance.StartVoiceSending();
}
public void BanTarget(UserId target){
RTCManager.Instance.HardMuteTargetUser(target, true);
}
}