EasyEvents.cs

Subscribe To Vivox Events

Subscribe to relevant Vivox events in Awake() or Start() methods. Check out the Login Events page to see examples on how to use EasyEvents

Audio Device Events

#region Audio Device Events

public event Action<IAudioDevice> AudioInputDeviceAdded;
public event Action<IAudioDevice> AudioInputDeviceRemoved;
public event Action<IAudioDevice> AudioInputDeviceUpdated;

public event Action<IAudioDevice> AudioOutputDeviceAdded;
public event Action<IAudioDevice> AudioOutputDeviceRemoved;
public event Action<IAudioDevice> AudioOutputDeviceUpdated;

#endregion

Uses EasyEvents.cs to access Login events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

Login Events

 // Subscribe to Login Related Events
 _events.LoggingIn += OnLoggingIn;
 _events.LoggedIn += OnLoggedIn;
 _events.LoggedIn += OnLoggedInSetup;
 _events.LoggingOut += OnLoggingOut;
 _events.LoggedOut += OnLoggedOut;
 
 _events.LoginAdded += OnLoginAdded;
 _events.LoginRemoved += OnLoginRemoved;
 _events.LoginUpdated += OnLoginUpdated;

Uses EasyEvents.cs to access Login events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

Channel Events

 // Subscribe to Channel Related Events
_events.ChannelConnecting += OnChannelConnecting;
_events.ChannelConnected += OnChannelConnected;
_events.ChannelDisconnecting += OnChannelDisconnecting;
_events.ChannelDisconnected += OnChannelDisconnected;

Uses EasyEvents.cs to access Channel events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

Audio Channel Events

 // Subscribe to Channel Related Events
_events.AudioChannelConnecting += OnVoiceConnecting;
_events.AudioChannelConnected += OnVoiceConnected;
_events.AudioChannelDisconnecting += OnVoiceDisconnecting;
_events.AudioChannelDisconnected += OnVoiceDisconnected;

Uses EasyEvents.cs to access Audio Channel events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

Text Channel Events

 // Subscribe to Channel Related Events
 _events.TextChannelConnecting += OnTextChannelConnecting;
 _events.TextChannelConnected += OnTextChannelConnected;
 _events.TextChannelDisconnecting += OnTextChannelDisconnecting;
 _events.TextChannelDisconnected += OnTextChannelDisconnected;

Uses EasyEvents.cs to access Text Channel events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

Message Events

 // Subscribe to Channel Message Related Events
_events.ChannelMessageRecieved += OnChannelMessageRecieved;
_events.EventMessageRecieved += OnEventMessageRecieved;

 // Subscribe to Direct Message Related Events
 _events.DirectMessageRecieved += OnDirectMessageRecieved;
 _events.DirectMessageFailed += OnDirectMessageFailed;

Uses EasyEvents.cs to access Channel and Direct message events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

User Events

The keywords Fire and Called are used interchangeably

_events.UserJoinedChannel += OnUserJoinedChannel;
_events.UserLeftChannel += OnUserLeftChannel;
_events.UserValuesUpdated += OnUserValuesUpdated;

Uses EasyEvents.cs to access User events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

_events.UserMuted -= OnUserMuted;
_events.UserUnmuted -= OnUserUnmuted;
_events.UserSpeaking -= OnUserSpeaking;
_events.UserNotSpeaking -= OnUserNotSpeaking;
_events.LocalUserMuted -= OnLocalUserMuted;
_events.LocalUserUnmuted -= OnLocalUserUnmuted;
_events.UserCrossMuted -= OnCrossMuted;
_events.UserCrossUnmuted -= OnCrossUnmuted;

Uses EasyEvents.cs to access User events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

Text To Speech ( TTS ) Events

 // Subscribe to Text-To-Speech related events
 _events.TTSMessageAdded += OnTTSMessageAdded;
 _events.TTSMessageRemoved += OnTTSMessageRemoved;
 _events.TTSMessageUpdated += OnTTSMessageUpdated;

Uses EasyEvents.cs to access Text-To-Speech events

You can also access EasyEvents by injecting it into your class using Zenject dependency injection. Read more about it here.

Unsubscribe From Vivox Events

Make sure to unsubscribe from all the events explained above on OnApplicationQuit() in Unity

Last updated