12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
-
- using System;
- using System.Text.RegularExpressions;
- using SC.XR.Unity;
- using UnityEngine;
- using UnityEngine.UI;
- using static ScenesManager;
- public class JoinRoom : RemoteSingleton<JoinRoom>
- {
- public SCInputField fieldName;
- public Text 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);
- }
- }
|