using System; using System.Text.RegularExpressions; using SC.XR.Unity; using TMPro; using UnityEngine; using UnityEngine.UI; using static ScenesManager; public class JoinRoom : RemoteSingleton { public SCInputField fieldName; public TextMeshProUGUI remind; public override void initShow() { base.initShow(); fieldName.text = ""; remind.gameObject.SetActive(false); fieldName.onValueChanged.RemoveAllListeners(); fieldName.onValueChanged.AddListener(UserValueChanged); } private void UserValueChanged(string arg0) { remind.gameObject.SetActive(false); } public void showOffice() { ScenesManager.Instance.showOffice(SceneType.OfficeWindow); } public bool isClick = false; private void OnEnable() { isClick = false; } private void OnDisable() { isClick = false; } public void Join() { if (fieldName.text != "" && !isClick) { isClick = true; OfficeWindow.Instance.OnJoinRoom(fieldName.text); } else { remind.text = "请输入房间号"; remind.gameObject.SetActive(true); } // ScenesManager.Instance.showWindow(SceneType.ShowRoom); } }