123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- using LitJson;
- using SUIFW;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class CreatRoomForms : BaseUIForms
- {
- public Text roomName;
- public Text roomType;
- public Text roomPeopleNum;
- public Text isRecode;
- public Text isDownload;
- public Toggle toggle;
- public Button returnBtn;
- public Button confirmBtn;
- private int index;
- private bool isClick = false;
- #region 窗体生命周期
- public override void Display()
- {
- base.Display();
- Init();
- }
- public override void Redisplay()
- {
- base.Redisplay();
- }
- public override void Freeze()
- {
- base.Freeze();
- }
- public override void Hiding()
- {
- base.Hiding();
- }
- #endregion
- private void Awake()
- {
- returnBtn.onClick.AddListener(Return);
- confirmBtn.onClick.AddListener(Create);
- }
- public void Init()
- {
- isClick = false;
- roomName.text = "房间名: " + RoomMainInfo.roomName;
- if (UserInfo.isSN)
- {
- roomType.text = "设备SN账号";
- roomPeopleNum.text = "2人";
- isRecode.text = "不支持";
- isDownload.text = "不支持";
- }
- else if (UserInfo.activateType == 1)
- {
- roomType.text = "未激活账号";
- roomPeopleNum.text = "2人";
- isRecode.text = "不支持";
- isDownload.text = "不支持";
- }
- else
- {
- roomType.text = "激活账号";
- roomPeopleNum.text = "10人";
- isRecode.text = "支持";
- isDownload.text = "支持";
- }
- toggle.onValueChanged.AddListener(remindTip);
- }
- public void remindTip(bool isRemind)
- {
- index = isRemind == true ? 1 : -1;
- }
- public void Create()
- {
- if (!isClick)
- {
- isClick = true;
- PlayerPrefs.SetInt("isRemindTip", index);
- OnCreateRoom();
- }
- }
- private void OnCreateRoom()
- {
- WSHandler.Office.OnGetRoomIdReveived -= getRoomId;
- WSHandler.Office.OnGetRoomIdReveived += getRoomId;
- WSHandler.Office.GetRoomID();
- }
- private void getRoomId(JsonData data)
- {
- WSHandler.Office.ChangeUserType(UserInfo.BusyType);
- RoomMainInfo.roomNum = data["data"]["roomId"].ToString();
- WSHandler.roomRtcinit(RoomMainInfo.roomNum);
- WSHandler.Office.OnGetRoomIdReveived -= getRoomId;
- }
- public void Return()
- {
- index = -1;
- toggle.isOn = false;
- CloseOrReturnUIForms();
- ShowUIForms(SysConst.MainPanelForms);
- }
- }
|