This commit is contained in:
YangHua 2023-11-23 21:50:27 +08:00
parent 2f4c3cc04b
commit dfc3c48216
2 changed files with 16 additions and 13 deletions

View File

@ -52,9 +52,9 @@ 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 +258,7 @@ public class View_Panel2 : XUIPanel
} }
public async void GetAllRoomData() public async void GetAllRoomData()
{ {
roomdata = await AsyncWebReq.Post<RoomData>(roomUrl, null); UIBootstrap.Instance. roomdata = await AsyncWebReq.Post<RoomData>(UIBootstrap.Instance.roomUrl, null);
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,16 +513,16 @@ public class View_Panel2 : XUIPanel
public void CreateRoom() public void CreateRoom()
{ {
for (int i = 0; i < roomdata.data.Count; i++) for (int i = 0; i < UIBootstrap.Instance.roomdata.data.Count; i++)
{ {
if (roomdata.data[i].State != 2) if (UIBootstrap.Instance.roomdata.data[i].State != 2)
{ {
CreateRoomBase(roomdata.data[i].Id, roomdata.data[i].Name); CreateRoomBase(UIBootstrap.Instance.roomdata.data[i].Id, UIBootstrap.Instance.roomdata.data[i].Name);
} }
} }
} }
public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
public void CreateRoomBase(string roomId, string name) public void CreateRoomBase(string roomId, string name)
{ {
@ -532,7 +532,7 @@ public class View_Panel2 : XUIPanel
roomItem.transform.Find("view_btn").GetComponent<Button>().onClick.AddListener(async () => roomItem.transform.Find("view_btn").GetComponent<Button>().onClick.AddListener(async () =>
{ {
Storm_and_capture_panl.gameObject.SetActive(true); Storm_and_capture_panl.gameObject.SetActive(true);
UIBootstrap.Instance.currentRoomData = await AsyncWebReq.Get<RSData.RoomSubjectData>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticesubject&PracticeId=" + roomItem.name); currentRoomData = await AsyncWebReq.Get<RSData.RoomSubjectData>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticesubject&PracticeId=" + roomItem.name);
currentRoomName = roomItem.name; currentRoomName = roomItem.name;
GlobalFlag.roomID = roomItem.name; GlobalFlag.roomID = roomItem.name;
GlobalFlag.practiceId = roomItem.name; GlobalFlag.practiceId = roomItem.name;
@ -540,7 +540,7 @@ public class View_Panel2 : XUIPanel
UIBootstrap.Instance.GetSceneData(GlobalFlag.practiceId); UIBootstrap.Instance.GetSceneData(GlobalFlag.practiceId);
UIBootstrap.Instance.GetAllDeviceData(); UIBootstrap.Instance.GetAllDeviceData();
Debug.Log(" roomItem.nameID==" + roomItem.name); Debug.Log(" roomItem.nameID==" + roomItem.name);
CreateSubjectItem(UIBootstrap.Instance.currentRoomData.data); CreateSubjectItem(currentRoomData.data);
}); });
} }
public RSData.SubjectInfo currentSubjectInfo = new RSData.SubjectInfo(); public RSData.SubjectInfo currentSubjectInfo = new RSData.SubjectInfo();

View File

@ -1,6 +1,7 @@
using AdamThinkDevicesData; using AdamThinkDevicesData;
using Newtonsoft.Json; using Newtonsoft.Json;
using PData; using PData;
using RDate;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@ -15,7 +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 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();
// 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,11 +65,11 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
public int GetRoomStateById(string Id) public int GetRoomStateById(string Id)
{ {
for (int i = 0; i < currentRoomData.data.Count; i++) for (int i = 0; i < roomdata.data.Count; i++)
{ {
if (currentRoomData.data[i].Id == Id) if (roomdata.data[i].Id == Id)
{ {
return currentRoomData.data[i].State; return roomdata.data[i].State;
} }
} }
return 0; return 0;