Compare commits
No commits in common. "3aae7026ec5cfcddf8b4b706f87c4c9c9f5dbd75" and "c6d15e3e9aafc89e5d73e7b2a1e273322e83badc" have entirely different histories.
3aae7026ec
...
c6d15e3e9a
|
@ -453,7 +453,7 @@ public class View_Panel2 : XUIPanel
|
||||||
selector_panl.gameObject.SetActive(true);
|
selector_panl.gameObject.SetActive(true);
|
||||||
CreateAllUser(userData.data);
|
CreateAllUser(userData.data);
|
||||||
EliminateAccount();
|
EliminateAccount();
|
||||||
Debug.Log($"currentSubjectID+currentSeatID={ currentSubjectID }={currentSeatID}");
|
Debug.Log($"currentSubjectID+currentSeatID=" + currentSubjectID + "=" + currentSeatID);
|
||||||
});
|
});
|
||||||
if (GlobalFlag.currentUser.role_code.Equals("04") || GlobalFlag.currentUser.role_code.Equals("05"))
|
if (GlobalFlag.currentUser.role_code.Equals("04") || GlobalFlag.currentUser.role_code.Equals("05"))
|
||||||
{
|
{
|
||||||
|
@ -523,6 +523,7 @@ public class View_Panel2 : XUIPanel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
|
||||||
|
|
||||||
public void CreateRoomBase(string roomId, string name)
|
public void CreateRoomBase(string roomId, string name)
|
||||||
{
|
{
|
||||||
|
@ -532,7 +533,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 +541,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();
|
||||||
|
@ -633,7 +634,6 @@ public class View_Panel2 : XUIPanel
|
||||||
if (sdi[index].UserAccount == GlobalFlag.currentUser.login_name)
|
if (sdi[index].UserAccount == GlobalFlag.currentUser.login_name)
|
||||||
{
|
{
|
||||||
item.transform.GetChild(2).GetComponent<Toggle>().graphic.color = Color.green;
|
item.transform.GetChild(2).GetComponent<Toggle>().graphic.color = Color.green;
|
||||||
GlobalFlag.practiceSeatId = item.name;
|
|
||||||
isAssigned = true;
|
isAssigned = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -676,7 +676,6 @@ public class View_Panel2 : XUIPanel
|
||||||
if (sdi[index].UserAccount == GlobalFlag.currentUser.login_name)
|
if (sdi[index].UserAccount == GlobalFlag.currentUser.login_name)
|
||||||
{
|
{
|
||||||
item.transform.GetChild(2).GetComponent<Toggle>().graphic.color = Color.green;
|
item.transform.GetChild(2).GetComponent<Toggle>().graphic.color = Color.green;
|
||||||
GlobalFlag.practiceSeatId = item.name;
|
|
||||||
isAssigned = true;
|
isAssigned = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -752,17 +751,11 @@ public class View_Panel2 : XUIPanel
|
||||||
ReturnRoomID returnRoomId = await AsyncWebReq.Post<ReturnRoomID>("http://111.229.30.246:48888/Handler/Practice.ashx?action=add&Name=" + currentRoomName + "&MissionModel=" + currentMissionModel + "&ThinkingId=" + currentThinkingId + "&AccountsInfo=" + accountInfo, null);
|
ReturnRoomID returnRoomId = await AsyncWebReq.Post<ReturnRoomID>("http://111.229.30.246:48888/Handler/Practice.ashx?action=add&Name=" + currentRoomName + "&MissionModel=" + currentMissionModel + "&ThinkingId=" + currentThinkingId + "&AccountsInfo=" + accountInfo, null);
|
||||||
if (returnRoomId.state)
|
if (returnRoomId.state)
|
||||||
{
|
{
|
||||||
string roomID = returnRoomId.data;
|
CreateRoomBase(returnRoomId.data, currentRoomName);
|
||||||
|
|
||||||
RoomState roomState = await AsyncWebReq.Post<RoomState>("http://111.229.30.246:48888/Handler/Practice.ashx?action=updatestate&Id=" + roomID + "&state=0", null);
|
|
||||||
//创建房间
|
//创建房间
|
||||||
if (roomState.message == "success")
|
string RoomName = "createroom " + returnRoomId.data;
|
||||||
{
|
|
||||||
CreateRoomBase(returnRoomId.data, currentRoomName);
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
||||||
}
|
|
||||||
Debug.Log($"<color=yellow> roomState=={roomState.message}</color>");
|
|
||||||
//string RoomName = "createroom " + returnRoomId.data;
|
|
||||||
//_ = AdamSync.SyncCreateRoom.SendMessageAsync(RoomName);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,23 +2,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
namespace RDate
|
namespace RDate
|
||||||
{
|
{
|
||||||
[Serializable]
|
|
||||||
public class RoomState
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string state;
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string message;
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string data;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class DataItem
|
public class DataItem
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using AdamSync;
|
using AdamSync;
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
using Boo.Lang;
|
using Boo.Lang;
|
||||||
using RDate;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -84,23 +83,22 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
///04 student 03 teacher
|
///04 student 03 teacher
|
||||||
if (GlobalFlag.currentUser.role_code == "04")
|
|
||||||
{
|
|
||||||
Teacher.gameObject.SetActive(false);
|
|
||||||
student.gameObject.SetActive(true);
|
|
||||||
GlobalFlag.isStartRehearsing = (UIBootstrap.Instance.GetRoomStateById(GlobalFlag.roomID) == 1);
|
|
||||||
Debug.Log($"<color=red>isStartRehearsing={ GlobalFlag.isStartRehearsing}</color>");
|
|
||||||
if (GlobalFlag.isStartRehearsing)
|
|
||||||
{
|
|
||||||
spt.GetComponent<Camera>().cullingMask = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (GlobalFlag.currentUser.role_code == "03")
|
if (GlobalFlag.currentUser.role_code == "03")
|
||||||
{
|
{
|
||||||
Teacher.gameObject.SetActive(true);
|
Teacher.gameObject.SetActive(true);
|
||||||
student.gameObject.SetActive(false);
|
student.gameObject.SetActive(false);
|
||||||
spt.GetComponent<Camera>().cullingMask = -1;
|
spt.GetComponent<Camera>().cullingMask = -1;
|
||||||
}
|
}
|
||||||
|
if (GlobalFlag.currentUser.role_code == "04")
|
||||||
|
{
|
||||||
|
Teacher.gameObject.SetActive(false);
|
||||||
|
student.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GlobalFlag.isStartRehearsing)
|
||||||
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = -1;
|
||||||
|
}
|
||||||
|
|
||||||
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
||||||
tenkokuModule.mainCamera = spt.transform;
|
tenkokuModule.mainCamera = spt.transform;
|
||||||
|
@ -111,7 +109,6 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
{
|
{
|
||||||
SetWeatherValue();
|
SetWeatherValue();
|
||||||
SetModelValue();
|
SetModelValue();
|
||||||
|
|
||||||
string msg = "getroomusers ";
|
string msg = "getroomusers ";
|
||||||
_ = SyncCreateRoom.SendMessageAsync(msg);
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
}
|
}
|
||||||
|
@ -179,7 +176,15 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "StartDeduction":
|
case "StartDeduction":
|
||||||
CheckRoomState();
|
GlobalFlag.isStartRehearsing = true;
|
||||||
|
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||||
|
{
|
||||||
|
DeviceManager.Instance.devices[i].isStartRehearsing = true;
|
||||||
|
}
|
||||||
|
if (GlobalFlag.currentUser.role_code == "04")
|
||||||
|
{
|
||||||
|
currentSpt.GetComponent<Camera>().cullingMask = -1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "无人机List":
|
case "无人机List":
|
||||||
SpawnDevice(wrjDrag.prefabItem, data);
|
SpawnDevice(wrjDrag.prefabItem, data);
|
||||||
|
@ -218,22 +223,6 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async void CheckRoomState()
|
|
||||||
{
|
|
||||||
RoomState roomState = await AsyncWebReq.Post<RoomState>("http://111.229.30.246:48888/Handler/Practice.ashx?action=updatestate&Id=" + GlobalFlag.roomID + "&state=1", null);
|
|
||||||
if (roomState.message == "success")
|
|
||||||
{
|
|
||||||
GlobalFlag.isStartRehearsing = true;
|
|
||||||
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
|
||||||
{
|
|
||||||
DeviceManager.Instance.devices[i].isStartRehearsing = true;
|
|
||||||
}
|
|
||||||
if (GlobalFlag.currentUser.role_code == "04")
|
|
||||||
{
|
|
||||||
currentSpt.GetComponent<Camera>().cullingMask = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
@ -356,7 +345,7 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void Reset()
|
private void Reset()
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,6 @@ 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();
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
private async void Start()
|
private async void Start()
|
||||||
{
|
{
|
||||||
|
@ -59,19 +58,6 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
return detaIteml;
|
return detaIteml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int GetRoomStateById(string Id)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < currentRoomData.data.Count; i++)
|
|
||||||
{
|
|
||||||
if (currentRoomData.data[i].Id == Id)
|
|
||||||
{
|
|
||||||
return currentRoomData.data[i].State;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<List_paraItem> GetListParaItemById(string deviceId)
|
public List<List_paraItem> GetListParaItemById(string deviceId)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < thinkDevicesData.data.Count; i++)
|
for (int i = 0; i < thinkDevicesData.data.Count; i++)
|
||||||
|
|
|
@ -7,9 +7,6 @@ public class GlobalFlag
|
||||||
public static UserInfo currentUser;
|
public static UserInfo currentUser;
|
||||||
public static string roomID;
|
public static string roomID;
|
||||||
public static string practiceId;
|
public static string practiceId;
|
||||||
/// <summary>
|
|
||||||
/// 席位ID
|
|
||||||
/// </summary>
|
|
||||||
public static string practiceSeatId;
|
public static string practiceSeatId;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///是否正在预演
|
///是否正在预演
|
||||||
|
|
|
@ -45,7 +45,7 @@ public static class AsyncWebReq
|
||||||
{
|
{
|
||||||
string reqJson = JsonConvert.SerializeObject(data);
|
string reqJson = JsonConvert.SerializeObject(data);
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
Debug.Log($"async req json : {reqJson}");
|
//Debug.Log($"async req json : {reqJson}");
|
||||||
#endif
|
#endif
|
||||||
var bodyRaw = Encoding.UTF8.GetBytes(reqJson);
|
var bodyRaw = Encoding.UTF8.GetBytes(reqJson);
|
||||||
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
||||||
|
|
Loading…
Reference in New Issue