using UnityEngine; using UnityEngine.UI; using Blue; using TMPro; using UnityEngine.Events; public class SupportControl : AbstractController { public bool Test = false; [SerializeField] private Button Titile_Btn; [SerializeField] private Toggle ShowHide_Toggle; [SerializeField] private Button UserList_Btn; [SerializeField] private Button ShowRtcHistory_Btn; private Transform ShowRtcTrans; private FontStyle FontStyleB = FontStyle.Bold; private FontStyle FontStyleN = FontStyle.Normal; [SerializeField] private TextMeshProUGUI UserList_Text; [SerializeField] private TextMeshProUGUI ShowRtcHistory_Text; private Color colorBlue = new Color32(25,107,255,255); private Color colorWhite = new Color32(255,255,255,255); public UnityEvent OnReset = new UnityEvent(); void Awake() { #if UNITY_EDITOR Test = true; #endif Init(); Titile_Btn.onClick.AddListener(() => { transform.position = ShowRtcTrans.position; Quaternion ang = Quaternion.LookRotation(OpenXRCamera.Instance.head.position - transform.position); transform.rotation = ang; transform.localEulerAngles = new Vector3(transform.localEulerAngles.x, transform.localEulerAngles.y + 180f, transform.localEulerAngles.z); }); UserList_Btn.onClick.AddListener(()=> { UserList_Text.fontStyle = (FontStyles)FontStyleB; ShowRtcHistory_Text.fontStyle = (FontStyles)FontStyleN; UserList_Text.color = colorBlue; ShowRtcHistory_Text.color = Color.white; }); ShowRtcHistory_Btn.onClick.AddListener(()=> { UserList_Text.fontStyle = (FontStyles)FontStyleN; ShowRtcHistory_Text.fontStyle = (FontStyles)FontStyleB; UserList_Text.color = Color.white; ShowRtcHistory_Text.color = colorBlue; }); } public void showRTC() { this.GetService().CreatRoom(); LangChaoRTC.Instance.showRTC(0); ScenesManager.Instance.showWindow(ScenesManager.SceneType.RoomMain); } public void Home() { ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowChoose); } public void Device() { ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowDevice); } public void Nav() { } public void History() { //ShowRTC.Instance.gotoWindow(ScenesManager.SceneType.ShowRTCHistory); } private void Init() { ShowRtcTrans = new GameObject("ShowRtcTrans").transform; ShowRtcTrans.position = OpenXRCamera.Instance.head.position + new Vector3(-1, 0, 0); ShowRtcTrans.localEulerAngles = new Vector3(0, -90, 0); ShowRtcTrans.SetParent(OpenXRCamera.Instance.head); } private void OnEnable() { OnReset?.Invoke(); } private void Update() { /* if (Test) return; OnReset?.Invoke(); */ } }