Easy Code For Vivox
  • Introduction
    • Official Links
    • Getting Started
      • Wheres The Code
      • Setup EasyCode in My Project
    • Setup Demo Scenes
      • Vivox Developer Portal
      • Unity Gaming Services (UGS) Dashboard
    • Things To Consider
    • FAQ
  • Development Info
    • Design Decisions
    • Release Notes
      • v2.0
      • v1.3
      • v1.2
      • v1.1
      • Template
    • Not Supported
  • Easy Code For Vivox
    • How do I setup EasyCode?
      • Setup Your Credentials
    • How do I do this in EasyCode?
      • Login / Logout
        • Login Properties
        • SetTransmissionMode
        • Login Events
      • Join / Leave Channel
        • Audio Channel
          • Audio Channel Events
        • Text Channel
          • Text Channel Events
        • Channel Events
      • Send Messages
        • Message Events
      • Mute / Unmute
        • Mute / Unmute Events
      • Subscribe to User Events
      • Volume / Audio Settings
        • Audio Device Events
      • Text To Speech ( TTS )
        • TTS Events
    • Vivox Access Tokens
      • Unity Cloud Code
    • Supported Vivox Events
      • Callback Methods
    • Folder Structure / Info
      • / Demo Scenes /
      • / Documentation /
      • / Examples /
      • / Plugins /
      • / Resources /
      • / Scripts /
      • / Settings /
    • Common Errors
  • API Info
    • EasySession.cs
    • EasyManager.cs
      • Main Methods
      • Vivox Event Callbacks
    • Easy3DPositional.cs
    • EasyVivoxUtilities.cs
    • EasySettings.cs
    • Extension Methods
      • EasySIPExtensions.cs
      • GameObjectExtensions.cs
      • TTSMessageExtensions.cs
      • UIExtensions.cs
      • VivoxExtensions.cs
      • EasyDebug.cs
    • EasyEvents.cs
  • Dependency Injection
    • Zenject vs Extenject
    • Install Dependencies
    • Inject Classes
  • Dynamic Events
    • Dynamic Events
    • Tests
    • Gotchas
    • Dynamic Async Events
      • Dont Do
    • Event Examples
  • Related Info
    • How do I do this in Vivox?
      • Conference Chat
    • Pre-Processor Directives
    • How to set iOS Info.plist for Unity?
    • Unity Gaming Services
  • The Future
    • Roadmap
    • Todo / Notes / Changelog
Powered by GitBook
On this page

Was this helpful?

  1. Development Info

Design Decisions

PreviousFAQNextRelease Notes

Last updated 2 years ago

Was this helpful?

EasyCode Opinionated Design Choices

  • EasyCode uses Zenject dependency injection internally so I can scale EasyCode without breaking projects in future releases, and to be friendly/compatible with teams working on big projects that already use dependency injection. Also, I am using Project Context prefab in Resources folder. If you have a Project Context as well it may conflict with EasyCode Project Context. Zenject supports IL2CPP but be aware there may be issues if using IL2CPP about IL2CPP compatibility

  • The 3D demo scene uses NetCodeForGameObjects. I was originally going to use Mirror Networking, but they made a lot of breaking changes and at the time (Oct 2022) tutorials I followed/bought weren't updated, so I decided to adopt NetCode since it's part of Unity's Ecosystem and was finally production ready.

  • Designed with some static variables to keep track of session (EasySession.cs), instead of Singleton design pattern, for persistent session data across scenes (I had problems properly Implementing Singleton, previous instances would be destroyed and replaced with new instances thus destroying session data. This happened back in late 2020/early 2021 when I was still a fairly new programmer. I have learned a lot since then and re-written/re-designed EasyCode about 3 1/2 times and still went with a few static variables over singleton design pattern).

  • Uses Reflection for Dynamic events. It is the slower option, but I don't know how to use Mono.Cecil or C# Dynamic Methods with IL Emit/Opcodes (maybe one day).

  • At the time of this writing namespace VivoxAccessToken located at Assets/EasyCodeForVivox/Plugins/VivoxAccessToken.dll is basically a direct copy of how to implement Vivox Access Token . I didn't change method names so it would be easier to reference the docs.

VivoxAccessToken may be changed in the future since later Unity Versions since they provide a NewtonSoft Json package in the Unity Package Manager which can be used to serialize instead of the JavaScriptWebSerializer. This would mean one less Plugin/dll to maintain separately, and source code would be included in EasyCode . Once Unity releases 2022 LTS I may make the switch to support 2020 and above with a dependency on Unity's version of NewtonSoft.Json

  • Designed EasyManager.cs to be inherited from. You can reference it using GetComponent<EasyManager>(); to gain access to its public methods or use Dependency Injection in your classes

  • Balance of Ease of Use and Performance (My laptop is pretty performant (Processor Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 2208 Mhz, 6 Core(s), 12 Logical Processor(s), 16 GB RAM, although I am running Docker on WSL so it does steal some performance) so results may vary. Only when using Dynamic events should you worry about performance. Even so events are fire and forget and you should never see a performance hit)

Designed with scaling in mind but if you think your game is going to have over 10, 000 players or need an enterprise solution I would look at Assets/EasyCodeForVivox/Scripts/VivoxBackend and EasyManager.cs And implement your own solution based on the code in this asset and Vivox documentation. Especially if you don't like my naming conventions or design . I am open to feedback and pull requests to make EasyCode a goto solution for Enterprise level games/apps

😁
read more here
from the Vivox documentation