添加设备数据上传接口
This commit is contained in:
parent
f74bd50678
commit
bae09e0de0
|
@ -574,6 +574,7 @@ public class View_Panel2 : XUIPanel
|
||||||
GameObject subjectTemp = GameObject.Instantiate(currentRoomSubjectItem, currentRoomSubjectItemConnect);
|
GameObject subjectTemp = GameObject.Instantiate(currentRoomSubjectItem, currentRoomSubjectItemConnect);
|
||||||
subjectTemp.SetActive(true);
|
subjectTemp.SetActive(true);
|
||||||
subjectTemp.name = di[index].Id;
|
subjectTemp.name = di[index].Id;
|
||||||
|
GlobalFlag.practiceSubjectID = subjectTemp.name;
|
||||||
subjectTemp.transform.GetChild(0).GetComponent<Text>().text = di[index].Name;
|
subjectTemp.transform.GetChild(0).GetComponent<Text>().text = di[index].Name;
|
||||||
subjectTemp.GetComponent<Button>().onClick.AddListener(async () =>
|
subjectTemp.GetComponent<Button>().onClick.AddListener(async () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,23 @@ using System;
|
||||||
|
|
||||||
namespace AdamThinkDevicesData
|
namespace AdamThinkDevicesData
|
||||||
{
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class ReturnDeviceID
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool state;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string message;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string data;
|
||||||
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class List_paraItem
|
public class List_paraItem
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,4 +16,8 @@ public class GlobalFlag
|
||||||
/// 当前想定ID
|
/// 当前想定ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string currentThinkId;
|
public static string currentThinkId;
|
||||||
|
/// <summary>
|
||||||
|
/// 当前房间科目ID
|
||||||
|
/// </summary>
|
||||||
|
public static string practiceSubjectID;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
using AdamSync;
|
using AdamSync;
|
||||||
|
using LitJson;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备
|
/// 设备
|
||||||
|
@ -85,12 +86,15 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="weaponitemone"></param>
|
/// <param name="weaponitemone"></param>
|
||||||
public void FillInTheData(List<List_paraItem> weaponitemone)
|
public async void FillInTheData(List<List_paraItem> weaponitemone)
|
||||||
{
|
{
|
||||||
if (equipmentCommon)
|
if (equipmentCommon)
|
||||||
{
|
{
|
||||||
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
string paraListJson = JsonMapper.ToJson(weaponitemone);
|
||||||
Debug.Log(msg);
|
ReturnDeviceID returnID = await AsyncWebReq.Post<ReturnDeviceID>("http://111.229.30.246:48888/Handler/Thinkingfile.ashx?action=querypracticedevicedetail&PracticeId=" + GlobalFlag.roomID + "&PracticeSubjectId=" + GlobalFlag.practiceSubjectID + "&device_name=" + equipmentCommon.equipmentType + "¶_list=" + paraListJson, null);
|
||||||
|
|
||||||
|
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "") + "," + returnID}";
|
||||||
|
Debug.Log(returnID.message);
|
||||||
_ = SyncCreateRoom.SendMessageAsync(msg);
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
}
|
}
|
||||||
switch (equipmentType)
|
switch (equipmentType)
|
||||||
|
@ -115,6 +119,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue