Skip to content

Instantly share code, notes, and snippets.

View icywind's full-sized avatar

Rick Cheng icywind

View GitHub Profile
void OnApplicationQuit()
{
if (mRtcEngine != null)
{
IRtcEngine.Destroy();
mRtcEngine = null;
}
}
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)
void SetupAgora()
{
mRtcEngine = IRtcEngine.GetEngine(AppID);
mRtcEngine.OnUserJoined = OnUserJoined;
mRtcEngine.OnUserOffline = OnUserOffline;
mRtcEngine.OnJoinChannelSuccess = OnJoinChannelSuccessHandler;
mRtcEngine.OnLeaveChannel = OnLeaveChannelHandler;
}
[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())
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
public class AvatarViewController : MonoBehaviour
{
[SerializeField]
Dropdown EffectDropdown;
[SerializeField]
GameObject EffectsParent;
.
├── Android
│   ├── AgoraRtcEngineKit.plugin
│   │   ├── AndroidManifest.xml
│   │   ├── AndroidManifest.xml.meta
│   │   ├── libs
│   │   │   ├── PLACEHOLDER
│   │   │   ├── PLACEHOLDER.meta
│   │   │   ├── agora-rtc-sdk.jar
│   │   │   ├── agora-rtc-sdk.jar.meta
Assets/
├── Editor
│   ├── BL_BuildPostProcess.cs
│   └── BL_BuildPostProcess.cs.meta
├── Editor.meta
├── Plugins
│   ├── Android
│   │   ├── AgoraRtcEngineKit.plugin
│   │   │   ├── AndroidManifest.xml
│   │   │   ├── AndroidManifest.xml.meta
@icywind
icywind / TestHelloUnityVideo.cs
Created May 30, 2020 00:01
Updated Demo project script to push external audio
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
@icywind
icywind / RAAR_IVideoChatClient.cs
Created April 3, 2020 19:03
The IVideoChatClient interface
public interface IVideoChatClient
{
void join(string channel);
void leave();
void loadEngine(string appId);
void unloadEngine();
void onSceneLoaded();
void EnableVideo(bool enable);
}
@icywind
icywind / RAAR_JoinChannel.cs
Created April 3, 2020 18:14
Joining a channel in AR Client
public void join(string channel)
{
Debug.Log("calling join (channel = " + channel + ")");
if (mRtcEngine == null)
return;
// set callbacks (optional)
mRtcEngine.OnJoinChannelSuccess = onJoinChannelSuccess;
mRtcEngine.OnUserJoined = onUserJoined;