Skip to content

Instantly share code, notes, and snippets.

@icywind icywind/AgoraUIManager.cs Secret

Created Oct 21, 2019
Embed
What would you like to do?
manager to respond to the UI Toggle actions
using UnityEngine;
using UnityEngine.UI;
public class AgoraUIManager : MonoBehaviour
{
void Start()
{
SetPosition();
}
void SetPosition()
{
transform.position = new Vector3(Screen.width - 20, Screen.height - 100, 0);
}
public void OnMicToggle(Toggle toggle)
{
Debug.Log("Toggle mic " + toggle.isOn);
AgoraVideoController.instance.MuteMic(!toggle.isOn);
}
public void OnCamToggle(Toggle toggle)
{
Debug.Log("Toggle cam" + toggle.isOn);
AgoraVideoController.instance.MuteCamera(!toggle.isOn);
}
public void OnCamSwitch(Toggle toggle)
{
Debug.Log("Switch cam " + toggle.isOn);
AgoraVideoController.instance.SwitchCamera();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.