This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void OnApplicationQuit() | |
{ | |
if (mRtcEngine != null) | |
{ | |
IRtcEngine.Destroy(); | |
mRtcEngine = null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void OnJoinChannelSuccessHandler(string channelName, uint uid, int elapsed) | |
{ | |
// can add other logics here, for now just print to the log | |
Debug.LogFormat("Joined channel {0} successful, my uid = {1}", channelName, uid); | |
} | |
void OnLeaveChannelHandler(RtcStats stats) | |
{ | |
myView.SetEnable(false); | |
if (remoteView != null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void SetupAgora() | |
{ | |
mRtcEngine = IRtcEngine.GetEngine(AppID); | |
mRtcEngine.OnUserJoined = OnUserJoined; | |
mRtcEngine.OnUserOffline = OnUserOffline; | |
mRtcEngine.OnJoinChannelSuccess = OnJoinChannelSuccessHandler; | |
mRtcEngine.OnLeaveChannel = OnLeaveChannelHandler; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[SerializeField] | |
private GameObject avatarVideoPrefab; | |
// Create new image plane to display users in party. | |
private void CreateUserVideoSurface(uint uid, bool isLocalUser, bool isAvatar) | |
{ | |
// Avoid duplicating Local player VideoSurface image plane. | |
for (int i = 0; i < playerVideoList.Count; i++) | |
{ | |
if (playerVideoList[i].name == uid.ToString()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections.Generic; | |
public class AvatarViewController : MonoBehaviour | |
{ | |
[SerializeField] | |
Dropdown EffectDropdown; | |
[SerializeField] | |
GameObject EffectsParent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── Android | |
│ ├── AgoraRtcEngineKit.plugin | |
│ │ ├── AndroidManifest.xml | |
│ │ ├── AndroidManifest.xml.meta | |
│ │ ├── libs | |
│ │ │ ├── PLACEHOLDER | |
│ │ │ ├── PLACEHOLDER.meta | |
│ │ │ ├── agora-rtc-sdk.jar | |
│ │ │ ├── agora-rtc-sdk.jar.meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assets/ | |
├── Editor | |
│ ├── BL_BuildPostProcess.cs | |
│ └── BL_BuildPostProcess.cs.meta | |
├── Editor.meta | |
├── Plugins | |
│ ├── Android | |
│ │ ├── AgoraRtcEngineKit.plugin | |
│ │ │ ├── AndroidManifest.xml | |
│ │ │ ├── AndroidManifest.xml.meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using agora_gaming_rtc; | |
using agora_utilities; | |
using System; | |
using System.Collections; | |
// this is an example of using Agora Unity SDK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IVideoChatClient | |
{ | |
void join(string channel); | |
void leave(); | |
void loadEngine(string appId); | |
void unloadEngine(); | |
void onSceneLoaded(); | |
void EnableVideo(bool enable); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void join(string channel) | |
{ | |
Debug.Log("calling join (channel = " + channel + ")"); | |
if (mRtcEngine == null) | |
return; | |
// set callbacks (optional) | |
mRtcEngine.OnJoinChannelSuccess = onJoinChannelSuccess; | |
mRtcEngine.OnUserJoined = onUserJoined; |