Scripting Agora functionality extended
Now that you have set up the SDK. Either you can use default test scripts available with SDK or you can extend the functionality the way you want.
You can refer to the basic implementation from Github Link or refer the documentation.
Basic method setup in order to connect with Agora.
Create AgoraEngineHandler.cs to manage agora engine functionalities in a sort of decoupled way.
// instance of agora engine
private IRtcEngine mRtcEngine;
Load/Unload Engine are same function as available with the package script TestHelloUnityVideo.cs
// load agora engine
public void loadEngine(string appId){ … }
// unload agora engine
public void unloadEngine(){ … }
Join and Leave channel functions are also similar as defined in TestHelloUnityVideo. But here, there are changes to the event callback function because we are managing user functionality separately.
AppEvents class has defined all the events that are going to be used across the application.
UserManager.cs
Here we are managing user callbacks from agora engine.
Conclusion
Hence, Audio and Video chat are one of the essential features which are helpful in increasing the engagement among players and hence it will play a vital role for a successful game.
This was just a basic setup to start working with agora.io in unity. There are many more features available by Agora for user interactive gaming. Audio and Video chat is an example for an engaging gaming experience.
This tutorial can be used to work with any existing game or application. Just grab the package and extend as per your flexibility and experience the Agora in action.