using UnityEngine; using UnityEngine.UI; using UnityEngine.Serialization; using UnityEngine.SceneManagement; using Agora.Rtc; using Agora.Util; using Logger = Agora.Util.Logger; using System.IO; using System; namespace Agora_RTC_Plugin.API_Example.Examples.Advanced.StartRhythmPlayer { public class StartRhythmPlayer : MonoBehaviour { [FormerlySerializedAs("appIdInput")] [SerializeField] private AppIdInput _appIdInput; [Header("_____________Basic Configuration_____________")] [FormerlySerializedAs("APP_ID")] [SerializeField] private string _appID = ""; [FormerlySerializedAs("TOKEN")] [SerializeField] private string _token = ""; [FormerlySerializedAs("CHANNEL_NAME")] [SerializeField] private string _channelName = ""; public Text LogText; internal Logger Log; internal IRtcEngine RtcEngine = null; // Use this for initialization private void Start() { LoadAssetData(); if (CheckAppId()) { SetupUI(); InitEngine(); JoinChannel(); } } private void Update() { PermissionHelper.RequestMicrophontPermission(); PermissionHelper.RequestCameraPermission(); } //Show data in AgoraBasicProfile [ContextMenu("ShowAgoraBasicProfileData")] private void LoadAssetData() { if (_appIdInput == null) return; _appID = _appIdInput.appID; _token = _appIdInput.token; _channelName = _appIdInput.channelName; } private bool CheckAppId() { Log = new Logger(LogText); return Log.DebugAssert(_appID.Length > 10, "Please fill in your appId in API-Example/profile/appIdInput.asset"); } private void SetupUI() { var btn = this.gameObject.transform.Find("StartButton").GetComponent