-
-
Save icywind/e64b7336cd364d3fd35dec24b74ef11c to your computer and use it in GitHub Desktop.
manager to respond to the UI Toggle actions
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; | |
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