Skip to content

Instantly share code, notes, and snippets.

Avatar

Rick Cheng icywind

View GitHub Profile
View AgoraSDK2.4-Tree.txt
Assets/
├── Editor
│   ├── BL_BuildPostProcess.cs
│   └── BL_BuildPostProcess.cs.meta
├── Editor.meta
├── Plugins
│   ├── Android
│   │   ├── AgoraRtcEngineKit.plugin
│   │   │   ├── AndroidManifest.xml
│   │   │   ├── AndroidManifest.xml.meta
View TestAudioSourceSend.cs
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 / TestHelloUnityVideo.cs
Created May 30, 2020
Updated Demo project script to push external audio
View TestHelloUnityVideo.cs
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 / ShareScreenMac.mm
Last active Apr 20, 2020
A library source to return a list of screen ids
View ShareScreenMac.mm
//
// ShareScreenMac.mm
// ShareScreenLib
//
// Created by Rick Cheng on 4/17/20.
// Copyright © 2020 Agora. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
@icywind
icywind / RAAR_IVideoChatClient.cs
Created Apr 3, 2020
The IVideoChatClient interface
View RAAR_IVideoChatClient.cs
public interface IVideoChatClient
{
void join(string channel);
void leave();
void loadEngine(string appId);
void unloadEngine();
void onSceneLoaded();
void EnableVideo(bool enable);
}
@icywind
icywind / AgoraPushFrame.cs
Created Apr 3, 2020
How to push external video source frame with a coroutine
View AgoraPushFrame.cs
// Push frame to the remote client
IEnumerator PushFrame(byte[] bytes, int width, int height, System.Action onFinish)
{
if (bytes == null || bytes.Length == 0)
{
Debug.LogError("Zero bytes found!!!!");
yield break;
}
IRtcEngine rtc = IRtcEngine.QueryEngine();
@icywind
icywind / RAAR_JoinChannel.cs
Created Apr 3, 2020
Joining a channel in AR Client
View RAAR_JoinChannel.cs
public void join(string channel)
{
Debug.Log("calling join (channel = " + channel + ")");
if (mRtcEngine == null)
return;
// set callbacks (optional)
mRtcEngine.OnJoinChannelSuccess = onJoinChannelSuccess;
mRtcEngine.OnUserJoined = onUserJoined;
@icywind
icywind / DrawDots.cs
Created Mar 23, 2020
Method to draw the dots from the given position
View DrawDots.cs
int dotCount = 0;
/// <summary>
///
/// </summary>
/// <param name="pos">Screen Position</param>
void DrawDot(Vector2 pos)
{
if (anchorGO == null)
{
anchorGO = new GameObject();
@icywind
icywind / CoProcessDrawing.cs
Created Mar 23, 2020
Method to send the data
View CoProcessDrawing.cs
IEnumerator CoProcessDrawing(DrawmarkModel dm)
{
string json = JsonUtility.ToJson(dm);
if (dataStreamId > 0)
{
rtcEngine.SendStreamMessage(dataStreamId, json);
}
yield return null;
}
@icywind
icywind / RAAR_DrawmarkModel.cs
Created Mar 23, 2020
A model for drawing points
View RAAR_DrawmarkModel.cs
[Serializable]
public class DrawmarkModel
{
public Color color;
public List<Vector2> points;
}
You can’t perform that action at this time.