This commit is contained in:
YangHua 2023-11-23 22:01:40 +08:00
parent dfc3c48216
commit 963fba3cde
2 changed files with 14 additions and 8 deletions

View File

@ -52,9 +52,10 @@ public class View_Panel2 : XUIPanel
public List<Button> buttonlist = new List<Button>();//克隆出来房间按钮 public List<Button> buttonlist = new List<Button>();//克隆出来房间按钮
public string roomUrl = "http://111.229.30.246:48888/Handler/Practice.ashx?action=query&state=0,1,2";
public string userUrl = "http://111.229.30.246:48888/Handler/User.ashx?action=all&role_code=04"; public string userUrl = "http://111.229.30.246:48888/Handler/User.ashx?action=all&role_code=04";
public RoomData roomdata = new RoomData();
public UserData userData = new UserData(); public UserData userData = new UserData();
public Dropdown roomModelDropdown;//房间模式 public Dropdown roomModelDropdown;//房间模式
public Dropdown thinkingDropdown;//选择想定 public Dropdown thinkingDropdown;//选择想定
@ -258,7 +259,8 @@ public class View_Panel2 : XUIPanel
} }
public async void GetAllRoomData() public async void GetAllRoomData()
{ {
UIBootstrap.Instance. roomdata = await AsyncWebReq.Post<RoomData>(UIBootstrap.Instance.roomUrl, null); roomdata = await AsyncWebReq.Post<RoomData>(roomUrl, null);
UIBootstrap.Instance.SetRoomdata(roomdata);
if (place.childCount > 0) if (place.childCount > 0)
{ {
for (int i = 0; i < place.childCount; i++) for (int i = 0; i < place.childCount; i++)
@ -513,11 +515,11 @@ public class View_Panel2 : XUIPanel
public void CreateRoom() public void CreateRoom()
{ {
for (int i = 0; i < UIBootstrap.Instance.roomdata.data.Count; i++) for (int i = 0; i < roomdata.data.Count; i++)
{ {
if (UIBootstrap.Instance.roomdata.data[i].State != 2) if (roomdata.data[i].State != 2)
{ {
CreateRoomBase(UIBootstrap.Instance.roomdata.data[i].Id, UIBootstrap.Instance.roomdata.data[i].Name); CreateRoomBase(roomdata.data[i].Id, roomdata.data[i].Name);
} }
} }

View File

@ -16,9 +16,9 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
public List<RSData.SubjectDataItem> subjectInfo = new List<RSData.SubjectDataItem>(); public List<RSData.SubjectDataItem> subjectInfo = new List<RSData.SubjectDataItem>();
public List<Traininginformation> traininginformations = new List<Traininginformation>(); public List<Traininginformation> traininginformations = new List<Traininginformation>();
public AdamThinkDevicesData.DeviceData thinkDevicesData = new AdamThinkDevicesData.DeviceData(); public AdamThinkDevicesData.DeviceData thinkDevicesData = new AdamThinkDevicesData.DeviceData();
//public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
public string roomUrl = "http://111.229.30.246:48888/Handler/Practice.ashx?action=query&state=0,1,2";
public RoomData roomdata = new RoomData(); public RoomData roomdata = new RoomData();
//public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
// Start is called before the first frame update // Start is called before the first frame update
private async void Start() private async void Start()
{ {
@ -62,6 +62,10 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
return detaIteml; return detaIteml;
} }
public void SetRoomdata(RoomData _roomdata)
{
roomdata = _roomdata;
}
public int GetRoomStateById(string Id) public int GetRoomStateById(string Id)
{ {