CreateRoom.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using LitJson;
  3. using rtc;
  4. using SC.XR.Unity;
  5. using TMPro;
  6. using UnityEngine;
  7. using UnityEngine.UI;
  8. using static ScenesManager;
  9. public class CreateRoom : RemoteSingleton<CreateRoom>
  10. {
  11. public TextMeshProUGUI roomName;
  12. public TextMeshProUGUI roomType;
  13. public TextMeshProUGUI roomPeopleNum;
  14. public TextMeshProUGUI isRecode;
  15. public TextMeshProUGUI isDownload;
  16. public Toggle toggle;
  17. public override void initShow()
  18. {
  19. base.initShow();
  20. roomName.text = RoomMainInfo.roomName;
  21. if (UserInfo.isSN)
  22. {
  23. roomType.text = "设备SN账号";
  24. roomPeopleNum.text = "2人";
  25. isRecode.text = "不支持";
  26. isDownload.text = "不支持";
  27. }
  28. else if (UserInfo.activateType == 1)
  29. {
  30. roomType.text = "未激活账号";
  31. roomPeopleNum.text = "2人";
  32. isRecode.text = "不支持";
  33. isDownload.text = "不支持";
  34. }
  35. else
  36. {
  37. roomType.text = "激活账号";
  38. roomPeopleNum.text = "10人";
  39. isRecode.text = "支持";
  40. isDownload.text = "支持";
  41. }
  42. toggle.onValueChanged.AddListener(remindTip);
  43. }
  44. int index;
  45. public void remindTip(bool isRemind)
  46. {
  47. index = isRemind == true ? 1 : -1;
  48. }
  49. private bool isClick = false;
  50. public void Create()
  51. {
  52. if (!isClick)
  53. {
  54. isClick = true;
  55. PlayerPrefs.SetInt("isRemindTip", index);
  56. OfficeWindow.Instance.OnCreateRoom();
  57. }
  58. }
  59. private void OnEnable()
  60. {
  61. isClick = false;
  62. }
  63. private void OnDisable()
  64. {
  65. isClick = false;
  66. }
  67. public void Close()
  68. {
  69. index = -1;
  70. toggle.isOn = false;
  71. ScenesManager.Instance.showOffice(SceneType.OfficeWindow);
  72. }
  73. }