123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 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<IRTCService>().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();
- */
- }
- }
|