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