private void OnDestroy() { if (client) { client.OnJoinedRoom.RemoveListener(OnJoinedRoom); client.OnPeerRemoved.RemoveListener(OnPeerRemoved); client.OnRoomUpdated.RemoveListener(OnRoomUpdated); } peerConnectionSource = null; }
private void Awake() { peerConnectionSource = new RTCPeerConnectionSource(); client = GetComponentInParent <RoomClient>(); peerUuidToConnection = new Dictionary <string, VoipPeerConnection>(); OnPeerConnection.SetExisting(peerUuidToConnection.Values); audioSource = CreateAudioSource(); audioSource.StartAudio(); }