EasyManager.cs

EasyManager inherits from MonoBehaviour so it can be attached to a GameObject and inherited to make your own Custom VivoxManager. EasyManager is basically a super class/wrapper for all EasyCode functionality. Instead of using EasyManager you can access EasyCode functionality directly/separately by injecting necessary classes in your script by using the [Inject] attribute. Read more about it here

Necessary libraries for EasyManager.cs to work. namespace separate's your project or script from other peoples scripts or libraries that use similar names to avoid compile errors. It also forces people to use a using statement when they want to use your script or library

using EasyCodeForVivox.Events;
using EasyCodeForVivox.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UnityEngine;
using VivoxUnity;
using Zenject;

namespace EasyCodeForVivox
{

Private variables that are set by the Initialize() method.

    private EasyLogin _login;
    private EasyChannel _channel;
    private EasyAudioChannel _voiceChannel;
    private EasyTextChannel _textChannel;
    private EasyUsers _users;
    private EasyMessages _messages;
    private EasyMute _mute;
    private EasyTextToSpeech _textToSpeech;
    private EasyAudio _audio;
    private EasySettingsSO _settings;
    private EasyEvents _events;

Intialize() method is used to Inject and assign the private variables to any classes EasyManager needs to function. Instances are injected by Zenject dependency injection by using the [Inject] attribute

circle-info

I have tried to break up bigger methods and explain them in better detail. By clicking the tabs or exapandles you will see more info reated to what each method is doing

InitializeClient() is used to initialize Vivox Client, register Dynamic Events, and subscribe to necessary events for EasyCode to work.

A Pre-Processor Directive is used to disable logging for builds for faster performance. Read more about it here

UnitializeClient() is used to clean up resources used by Vivox and EasyCode. Also used to subscribe from events to prevent memory leaks

Subscribe To Vivox Events

SubscribeToVivoxEvents(); Subscribes to relevant Vivox events .

Audio Device Events

Use EasySession.cs to access VivoxClient (Client) and its Audio Device events

Login Events

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

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

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

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

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

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.

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

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

UnsubscribeToVivoxEvents() unsubscribes from all the events explained above. Refer to explanations above for each category. This is called on OnApplicationQuit() in Unity

Last updated