接口合并
This commit is contained in:
parent
7969fa9585
commit
8530a158b8
|
@ -1477,7 +1477,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
}
|
}
|
||||||
private void Addweapons()
|
private void Addweapons()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=adddevice";
|
|
||||||
List<DataItem1> datalist = new List<DataItem1>();
|
List<DataItem1> datalist = new List<DataItem1>();
|
||||||
for (int i = 0; i < namelists.Count; i++)
|
for (int i = 0; i < namelists.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -1501,7 +1501,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
//dic.Add("action", "adddevice");
|
//dic.Add("action", "adddevice");
|
||||||
dic.Add("think_id", "" + Id + "");
|
dic.Add("think_id", "" + Id + "");
|
||||||
dic.Add("data", datas);
|
dic.Add("data", datas);
|
||||||
StartCoroutine(PostData(url, dic, getInfo2));
|
StartCoroutine(PostData(Url_Adddevice, dic, getInfo2));
|
||||||
}
|
}
|
||||||
public void getInfo2(bool bol, string str)
|
public void getInfo2(bool bol, string str)
|
||||||
{
|
{
|
||||||
|
@ -1550,7 +1550,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
|
|
||||||
private void Dronereal()
|
private void Dronereal()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=adddevicepara";
|
|
||||||
List<Aircraft> aircrafts = new List<Aircraft>();
|
List<Aircraft> aircrafts = new List<Aircraft>();
|
||||||
if (uavnamelist2.Count>0)
|
if (uavnamelist2.Count>0)
|
||||||
{
|
{
|
||||||
|
@ -1577,7 +1577,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||||
dic.Add("think_device_id", stringlist[2]);
|
dic.Add("think_device_id", stringlist[2]);
|
||||||
dic.Add("data", str);
|
dic.Add("data", str);
|
||||||
StartCoroutine(PostData2(url, dic, One10));
|
StartCoroutine(PostData2(Url_Adddevicepara, dic, One10));
|
||||||
}
|
}
|
||||||
public void One10(bool bol, string str)
|
public void One10(bool bol, string str)
|
||||||
{
|
{
|
||||||
|
@ -1588,7 +1588,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
|
|
||||||
private void Wirelessoutput()
|
private void Wirelessoutput()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=adddevicepara";
|
|
||||||
List<Aircraft> aircrafts = new List<Aircraft>();
|
List<Aircraft> aircrafts = new List<Aircraft>();
|
||||||
if (wirelesslist2.Count>0)
|
if (wirelesslist2.Count>0)
|
||||||
{
|
{
|
||||||
|
@ -1612,7 +1612,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||||
dic.Add("think_device_id", stringlist[1]);
|
dic.Add("think_device_id", stringlist[1]);
|
||||||
dic.Add("data", str);
|
dic.Add("data", str);
|
||||||
StartCoroutine(PostData2(url, dic, One1));
|
StartCoroutine(PostData2(Url_Adddevicepara, dic, One1));
|
||||||
}
|
}
|
||||||
public void One1(bool bol, string str)
|
public void One1(bool bol, string str)
|
||||||
{
|
{
|
||||||
|
@ -1623,7 +1623,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
|
|
||||||
private void Laserfirecontrol()
|
private void Laserfirecontrol()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=adddevicepara";
|
|
||||||
List<Aircraft> aircrafts = new List<Aircraft>();
|
List<Aircraft> aircrafts = new List<Aircraft>();
|
||||||
for (int i = 0; i < laserlist.Count; i++)
|
for (int i = 0; i < laserlist.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -1638,7 +1638,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||||
dic.Add("think_device_id", stringlist[3]);
|
dic.Add("think_device_id", stringlist[3]);
|
||||||
dic.Add("data", str);
|
dic.Add("data", str);
|
||||||
StartCoroutine(PostData2(url, dic, One));
|
StartCoroutine(PostData2(Url_Adddevicepara, dic, One));
|
||||||
}
|
}
|
||||||
public void One(bool bol, string str)
|
public void One(bool bol, string str)
|
||||||
{
|
{
|
||||||
|
@ -1649,7 +1649,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
|
|
||||||
private void Saveaeroplane()
|
private void Saveaeroplane()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=adddevicepara";
|
|
||||||
List<Aircraft> aircrafts = new List<Aircraft>();
|
List<Aircraft> aircrafts = new List<Aircraft>();
|
||||||
for (int i = 0; i < Rettalist.Count; i++)
|
for (int i = 0; i < Rettalist.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -1664,7 +1664,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||||
dic.Add("think_device_id", stringlist[0]);
|
dic.Add("think_device_id", stringlist[0]);
|
||||||
dic.Add("data", str);
|
dic.Add("data", str);
|
||||||
StartCoroutine(PostData2(url, dic, getInfo4));
|
StartCoroutine(PostData2(Url_Adddevicepara, dic, getInfo4));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getInfo4(bool arg1, string arg2)
|
private void getInfo4(bool arg1, string arg2)
|
||||||
|
@ -1707,7 +1707,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
|
|
||||||
private void Preservation()
|
private void Preservation()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=updatedevice";
|
|
||||||
List<DataItem1> dataItem1s = new List<DataItem1>();
|
List<DataItem1> dataItem1s = new List<DataItem1>();
|
||||||
for (int i = 0; i < weaponitem.data.Count; i++)
|
for (int i = 0; i < weaponitem.data.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -1730,7 +1730,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
Debug.LogError(dataitem);
|
Debug.LogError(dataitem);
|
||||||
Dictionary<string, string> map = new Dictionary<string, string>();
|
Dictionary<string, string> map = new Dictionary<string, string>();
|
||||||
map.Add("data", dataitem);
|
map.Add("data", dataitem);
|
||||||
StartCoroutine(PostData(url, map, getInfo1));//协程调用网络通信
|
StartCoroutine(PostData(Url_updatedevice, map, getInfo1));//协程调用网络通信
|
||||||
}
|
}
|
||||||
public void getInfo1(bool bol, string str)
|
public void getInfo1(bool bol, string str)
|
||||||
{
|
{
|
||||||
|
@ -1739,13 +1739,13 @@ public class Scenariopage : MonoBehaviour
|
||||||
}
|
}
|
||||||
private void Modelitem()
|
private void Modelitem()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=updatecontent";
|
|
||||||
string jsonmodel = Newtonsoft.Json.JsonConvert.SerializeObject(DragManager.Instance.deviceimages1);//把模型路径和位置参数转成json对象
|
string jsonmodel = Newtonsoft.Json.JsonConvert.SerializeObject(DragManager.Instance.deviceimages1);//把模型路径和位置参数转成json对象
|
||||||
//Debug.LogError(jsonmodel);
|
//Debug.LogError(jsonmodel);
|
||||||
Dictionary<string, string> model = new Dictionary<string, string>();
|
Dictionary<string, string> model = new Dictionary<string, string>();
|
||||||
model.Add("Id", "" + Id + "");//对应的想定ID
|
model.Add("Id", "" + Id + "");//对应的想定ID
|
||||||
model.Add("DeviceContent", jsonmodel);//把对应的Json传到接口对应的字段里面
|
model.Add("DeviceContent", jsonmodel);//把对应的Json传到接口对应的字段里面
|
||||||
StartCoroutine(PostData1(url, model, Model));
|
StartCoroutine(PostData1(Url_updatecontent, model, Model));
|
||||||
|
|
||||||
}
|
}
|
||||||
public void Model(bool s, string str)
|
public void Model(bool s, string str)
|
||||||
|
@ -2061,7 +2061,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
}
|
}
|
||||||
void Passbyvalue()
|
void Passbyvalue()
|
||||||
{
|
{
|
||||||
string url = "http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=update_env";//获取需要传值的接口
|
|
||||||
|
|
||||||
Environment Environment = new Environment();//需要传值对应类
|
Environment Environment = new Environment();//需要传值对应类
|
||||||
//把需要传的值对象参数对应
|
//把需要传的值对象参数对应
|
||||||
|
@ -2076,7 +2076,7 @@ public class Scenariopage : MonoBehaviour
|
||||||
Dictionary<string, string> formDic = new Dictionary<string, string>();//用字典保存到对应的想定id里面
|
Dictionary<string, string> formDic = new Dictionary<string, string>();//用字典保存到对应的想定id里面
|
||||||
formDic.Add("Id", "" + Id + "");
|
formDic.Add("Id", "" + Id + "");
|
||||||
formDic.Add("data", res);
|
formDic.Add("data", res);
|
||||||
StartCoroutine(PostData(url, formDic, GetInfo));//协程调用网络通信
|
StartCoroutine(PostData(Url_update_env, formDic, GetInfo));//协程调用网络通信
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isLinkAgain: 0
|
isLinkAgain: 0
|
||||||
serverIP: 192.168.6.15
|
serverIP: 172.20.10.5
|
||||||
port: 12345
|
port: 12345
|
||||||
--- !u!4 &2132962759
|
--- !u!4 &2132962759
|
||||||
Transform:
|
Transform:
|
||||||
|
|
|
@ -34,7 +34,26 @@ public static class InterfaceManager
|
||||||
/// 查询想定设备
|
/// 查询想定设备
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string Url_Querydevice { get => IpAddress + "/Handler/Thinkingfile.ashx?action=querydevice&"; }
|
public static string Url_Querydevice { get => IpAddress + "/Handler/Thinkingfile.ashx?action=querydevice&"; }
|
||||||
|
/// <summary>
|
||||||
|
/// 添加设备
|
||||||
|
/// </summary>
|
||||||
|
public static string Url_Adddevice { get => IpAddress + "/Handler/Thinkingfile.ashx?action=adddevice"; }
|
||||||
|
/// <summary>
|
||||||
|
/// 添加设备参数
|
||||||
|
/// </summary>
|
||||||
|
public static string Url_Adddevicepara { get => IpAddress + "/Handler/Thinkingfile.ashx?action=adddevicepara"; }
|
||||||
|
/// <summary>
|
||||||
|
/// 修改想定接口
|
||||||
|
/// </summary>
|
||||||
|
public static string Url_updatedevice { get => IpAddress + "/Handler/Thinkingfile.ashx?action=updatedevice"; }
|
||||||
|
/// <summary>
|
||||||
|
/// 添加模型路径参数接口
|
||||||
|
/// </summary>
|
||||||
|
public static string Url_updatecontent { get => IpAddress + "/Handler/Thinkingfile.ashx?action=updatecontent"; }
|
||||||
|
/// <summary>
|
||||||
|
/// 修改环境
|
||||||
|
/// </summary>
|
||||||
|
public static string Url_update_env { get => IpAddress + "/Handler/Thinkingfile.ashx?action=update_env"; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public static string GetLocalTxt(string path)
|
public static string GetLocalTxt(string path)
|
||||||
|
|
Loading…
Reference in New Issue