123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- using Blue;
- using SC.XR.Unity.Module_InputSystem;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using static ScenesManager;
- public class LiveRTCRoomMain : MonoSingleton<LiveRTCRoomMain>,IController
- {
- public Button videoOpenBtn;
- public Button videoCloseBtn;
- public Button audioOpenBtn;
- public Button audioCloseBtn;
- public Button clearArrowBtn;
- public Button leaveRoomBtn;
- public GameObject defaultUI;
- public Button noBtn;
- public Button yesBtn;
- public RawImage rtcRawImage;
- public ManipulationHandler dragBtn;
-
- private void Start()
- {
- OnInit();
- dragBtn.Target = transform.parent;
- }
- private void Update()
- {
- if (RTCRoomManager.Instance.expertView != null)
- {
- if (!rtcRawImage.gameObject.activeSelf)
- rtcRawImage.gameObject.SetActive(true);
- rtcRawImage.texture = RTCRoomManager.Instance.expertView.VideoView;
- }
- else
- {
- if (rtcRawImage.gameObject.activeSelf)
- rtcRawImage.gameObject.SetActive(false);
- }
-
- }
- private void OnInit()
- {
- videoOpenBtn.onClick.AddListener(()=> { SetVideo(false); });
- videoCloseBtn.onClick.AddListener(() => { SetVideo(true); });
- audioOpenBtn.onClick.AddListener(() => { SetAudio(false); });
- audioCloseBtn.onClick.AddListener(() => { SetAudio(true); });
- clearArrowBtn.onClick.AddListener(ClearAllArrow);
- leaveRoomBtn.onClick.AddListener(() => { SetDefaultUI(true); });
- noBtn.onClick.AddListener(() => { SetDefaultUI(false); });
- yesBtn.onClick.AddListener(LeaveRoom);
- }
- public void SetAudio(bool state)
- {
- GHZRtcManager.Instance.OnMicrophone(state);
- audioCloseBtn.gameObject.SetActive(!state);
- audioOpenBtn.gameObject.SetActive(state);
- }
- public void SetVideo(bool state)
- {
-
- GHZRtcManager.Instance.OnWebCam(state);
- videoCloseBtn.gameObject.SetActive(!state);
- videoOpenBtn.gameObject.SetActive(state);
- }
- public void ClearAllArrow()
- {
- if (ArrowList.Instance)
- {
- ArrowList.Instance.DeleteAll();
- }
- }
-
- public void SetDefaultUI(bool state)
- {
- defaultUI.SetActive(state);
- }
- public void LeaveRoom()
- {
- RTCRoomManager.Instance.LeaveChannel();
- if (PopPeerView.Instance)
- {
- PopPeerView.Instance.list.SetParent(PopPublic.Instance.transform);
- PopPeerView.Instance.list.localPosition = new Vector3(0, 0, 0);
- PopPeerView.Instance.list.localEulerAngles = new Vector3(0, 0, 0);
- }
- if (PopUpInfo.Instance)
- {
- PopUpInfo.Instance.transform.SetParent(PopPublic.Instance.transform);
- PopUpInfo.Instance.transform.localPosition = new Vector3(0, 0, 0);
- PopUpInfo.Instance.transform.localEulerAngles = new Vector3(0, 0, 0);
- }
- ScenesManager.Instance.showWindow(SceneType.ShowChoose);
- if (InviteDlg.Instance)
- {
- InviteDlg.Instance.InvitingUnionIdList.Clear();
- }
- if (ArrowList.Instance)
- {
- ArrowList.Instance.DeleteAll();
- }
- if (RoomFile.Instance)
- {
- RoomFile.Instance.ClearAllFileItem();
- }
- if (PrintscreenList.Instance)
- {
- PrintscreenList.Instance.DeleteAll();
- }
- if (PopPeerView.Instance)
- {
- PopPeerView.Instance.DestoryAll();
- }
- if (PopCall.Instance)
- {
- PopCall.Instance.gameObject.SetActive(false);
- }
- if (ShowRoom.Instance)
- {
- ShowRoom.Instance.ShowMainScreen();
- ShowRoom.Instance.transform.localPosition = new Vector3(0, 0, 0);
- ShowRoom.Instance.transform.localEulerAngles = new Vector3(0, 0, 0);
- }
- API_GSXR_Slam.GSXR_Reset_Slam();
- // RemoteRtc.Instance.FiltrationCamera(true);
- }
-
-
- }
|