CreateRoom.cs 1.8 KB

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