Browse Source

人员定位配置提交

develop
孟涛 1 year ago
parent
commit
6066f52411
  1. 1
      Assets/Scripts/Common/GameManager.cs
  2. 8
      Assets/Scripts/Main/Core/PersonnelLocation/LocationSimulator.cs
  3. 8
      Assets/Scripts/Manager/Config.cs
  4. 2
      Assets/Scripts/UIManager/View/PersonnelLocationPanel.cs
  5. 7
      Assets/StreamingAssets/Config.json

1
Assets/Scripts/Common/GameManager.cs

@ -48,6 +48,7 @@ public class GameManager : Singleton<GameManager>
Config.Tags = webConfig.Tags; Config.Tags = webConfig.Tags;
Config.Range = webConfig.Range; Config.Range = webConfig.Range;
Config.Interval = webConfig.Interval; Config.Interval = webConfig.Interval;
Config.MapId = webConfig.MapId;
Config.AlarmServer = webConfig.AlarmServer; Config.AlarmServer = webConfig.AlarmServer;
Config.AlarmInterval = webConfig.AlarmInterval; Config.AlarmInterval = webConfig.AlarmInterval;
Debug.Log("ServerAddress:" + Config.ServerAddress + " Interval:" + Config.Interval + " Range:" + Config.Range); Debug.Log("ServerAddress:" + Config.ServerAddress + " Interval:" + Config.Interval + " Range:" + Config.Range);

8
Assets/Scripts/Main/Core/PersonnelLocation/LocationSimulator.cs

@ -199,7 +199,7 @@ public class LocationSimulator : MonoBehaviour
{ {
while (true) while (true)
{ {
var url = $"{Config.LocationServer}/le/uwbofferdata/getPositionDataByMapId/12"; var url = $"{Config.LocationServer}/le/uwbofferdata/getPositionDataByMapId/{Config.MapId}";
HttpManager.Instance.Get<PositionData>(url, tempData => HttpManager.Instance.Get<PositionData>(url, tempData =>
{ {
if (tempData.errorCode != 1) if (tempData.errorCode != 1)
@ -221,7 +221,9 @@ public class LocationSimulator : MonoBehaviour
if (agentControllers.ContainsKey(data.targetNo)) if (agentControllers.ContainsKey(data.targetNo))
{ {
agentControllers[data.targetNo].UpdatePosition(data); //agentControllers[data.targetNo].UpdatePosition(data);
agentControllers[data.targetNo].enabled = false;
agentControllers[data.targetNo].transform.position = Main.LocationSimulator.ConversionTransform(data);
} }
else else
{ {
@ -312,7 +314,7 @@ public class LocationSimulator : MonoBehaviour
/// <returns></returns> /// <returns></returns>
public Vector3 ConversionTransform(LocationData data) public Vector3 ConversionTransform(LocationData data)
{ {
var pos = new Vector3(-((float)data.xAxis+offsetX), -17.7f, -((float)data.yAxis+offsetZ)); var pos = new Vector3(-((float)data.xAxis - offsetX), -17.7f, -((float)data.yAxis - offsetZ));
//pos.y = SetY(pos); //pos.y = SetY(pos);
return pos; return pos;

8
Assets/Scripts/Manager/Config.cs

@ -23,6 +23,10 @@ public static class Config
/// </summary> /// </summary>
public static string LocationServer { get; set; } public static string LocationServer { get; set; }
/// <summary> /// <summary>
/// 人员定位接口地图id
/// </summary>
public static string MapId { get; set; }
/// <summary>
/// 人员定位报警接口 /// 人员定位报警接口
/// </summary> /// </summary>
public static string AlarmServer { get; set; } public static string AlarmServer { get; set; }
@ -71,6 +75,10 @@ public class ConfigWebGL
/// </summary> /// </summary>
public string LocationServer { get; set; } public string LocationServer { get; set; }
/// <summary> /// <summary>
/// 人员定位接口地图id
/// </summary>
public string MapId { get; set; }
/// <summary>
/// 人员定位报警接口 /// 人员定位报警接口
/// </summary> /// </summary>
public string AlarmServer { get; set; } public string AlarmServer { get; set; }

2
Assets/Scripts/UIManager/View/PersonnelLocationPanel.cs

@ -96,7 +96,7 @@ public class PersonnelLocationPanel : UIView
private void GetPersonnelData() private void GetPersonnelData()
{ {
numbsrs.Clear(); numbsrs.Clear();
var url = $"{Config.LocationServer}/le/uwbofferdata/getPositionDataByMapId/12"; var url = $"{Config.LocationServer}/le/uwbofferdata/getPositionDataByMapId/{Config.MapId}";
HttpManager.Instance.Get<PositionData>(url, tempData => HttpManager.Instance.Get<PositionData>(url, tempData =>
{ {
if (tempData.list.Count > 0) if (tempData.list.Count > 0)

7
Assets/StreamingAssets/Config.json

@ -3,10 +3,11 @@
"BucketName": "WebPlan", "BucketName": "WebPlan",
"AreaName": "虹口区", "AreaName": "虹口区",
"CompanyName": "凯德龙之梦", "CompanyName": "凯德龙之梦",
"LocationServer": "http://96291c6.r8.cpolar.top", "LocationServer": "http://101.201.70.191:8080",
"AlarmServer":"http://3949b92f.r6.cpolar.top", "AlarmServer":"http://101.201.70.191:8080",
"MapId":"4",
"PersonnelVideoUrl":"https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8", "PersonnelVideoUrl":"https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8",
"Tags": ["10777839","10777836","10777842","10777826","10777827","10774520","10777834","10777831","10774521","10774529","10774519","10774527","10774530","10774508","10770002"], "Tags": ["10671050","10671051","10671052","10671053","10671054","10671057","10671058","10671059","10671061","10671064"],
"Interval":1, "Interval":1,
"Range":0.3, "Range":0.3,
"AlarmInterval":10 "AlarmInterval":10

Loading…
Cancel
Save