diff --git a/Assets/StreamingAssets/IPPort.txt b/Assets/StreamingAssets/IPPort.txt index 8e7c2bee..298829e4 100644 --- a/Assets/StreamingAssets/IPPort.txt +++ b/Assets/StreamingAssets/IPPort.txt @@ -1 +1 @@ -172.20.10.5:48888 \ No newline at end of file +127.0.0.1:48888 \ No newline at end of file diff --git a/Assets/StreamingAssets/confing.txt b/Assets/StreamingAssets/confing.txt index 90dc926e..e56ea71e 100644 --- a/Assets/StreamingAssets/confing.txt +++ b/Assets/StreamingAssets/confing.txt @@ -1 +1 @@ -172.20.10.5 \ No newline at end of file +127.0.0.1 \ No newline at end of file diff --git a/Assets/StreamingAssets/mqttConfig.json b/Assets/StreamingAssets/mqttConfig.json index a632f329..9ca72740 100644 --- a/Assets/StreamingAssets/mqttConfig.json +++ b/Assets/StreamingAssets/mqttConfig.json @@ -1 +1 @@ -{"ip":"172.16.1.117","port":54232,"userName":"server1234","passwd":"123456"} \ No newline at end of file +{"ip":"172.16.1.120","port":54232,"userName":"server1234","passwd":"123456"} \ No newline at end of file diff --git a/Assets/Temp/Scripts/Judgmentstate.cs b/Assets/Temp/Scripts/Judgmentstate.cs index 5e6fcca9..8eb9a309 100644 --- a/Assets/Temp/Scripts/Judgmentstate.cs +++ b/Assets/Temp/Scripts/Judgmentstate.cs @@ -1,10 +1,7 @@ using AdamSync; -using System.Collections; -using System.Collections.Generic; using UnityEngine; -using UnityEngine.SceneManagement; using UnityEngine.UI; - +using static InterfaceManager; public class Judgmentstate : MonoBehaviour { @@ -83,7 +80,14 @@ public class Judgmentstate : MonoBehaviour _ = SyncCreateRoom.SendMessageAsync(msg); }); off_btn.onClick.AddListener(() => { - Application.Quit(); + string url = Url_Exit + GlobalFlag.currentUser.login_name; + StartCoroutine(GetString(url, data => + { + Debug.Log(data); + Application.Quit(); + + })); + }); } diff --git a/Assets/Temp/Scripts/Login_panl.cs b/Assets/Temp/Scripts/Login_panl.cs index 44e59e39..39b76ab2 100644 --- a/Assets/Temp/Scripts/Login_panl.cs +++ b/Assets/Temp/Scripts/Login_panl.cs @@ -1,7 +1,8 @@ -using LitJson; +using LitJson; using System.Collections; using UnityEngine; using UnityEngine.Networking; +using UnityEngine.SceneManagement; using UnityEngine.UI; using static InterfaceManager; public class Login_panl : MonoBehaviour @@ -102,6 +103,28 @@ public class Login_panl : MonoBehaviour } } + /// + /// 账号用户退出 + /// + /// 返回 退出 + public void AddGetString(bool exirOrQuit) + { + string url = Url_Exit + GlobalFlag.currentUser.login_name; + StartCoroutine(GetString(url, data => + { + Debug.Log(data); + if (exirOrQuit) + { + SceneManager.LoadScene("SampleScene"); + } + else + { + Application.Quit(); + } + + })); + } + public void OnRegist(string msg) { //Debug.Log("OnRegist====" + msg); diff --git a/Assets/Temp/Scripts/Scenariopage.cs b/Assets/Temp/Scripts/Scenariopage.cs index 8ed2a1e9..7d6b0c4f 100644 --- a/Assets/Temp/Scripts/Scenariopage.cs +++ b/Assets/Temp/Scripts/Scenariopage.cs @@ -415,12 +415,12 @@ public class Scenariopage : MonoBehaviour if (ison) { pingpu3 += index + ","; - Debug.Log(pingpu3); + //Debug.Log(pingpu3); } else { pingpu3 = pingpu3.Replace(index + ",", ""); - Debug.Log(pingpu3); + //Debug.Log(pingpu3); } })); } @@ -439,12 +439,12 @@ public class Scenariopage : MonoBehaviour if (ison) { frequ += index + ","; - Debug.Log(frequ); + //Debug.Log(frequ); } else { frequ = frequ.Replace(index + ",", ""); - Debug.Log(frequ); + //Debug.Log(frequ); } })); } @@ -508,8 +508,8 @@ public class Scenariopage : MonoBehaviour private void WB(bool arg1, string arg2) { - Debug.LogError(arg1); - Debug.LogError(arg2); + //Debug.LogError(arg1); + //Debug.LogError(arg2); } private void Bobomethod() @@ -611,8 +611,8 @@ public class Scenariopage : MonoBehaviour private void PPTCWQ(bool arg1, string arg2) { - Debug.LogError(arg1); - Debug.LogError(arg2); + //Debug.LogError(arg1); + //Debug.LogError(arg2); } private void Spectrumweapon1() @@ -626,7 +626,7 @@ public class Scenariopage : MonoBehaviour { if (bol) { - Debug.LogError(str); + //Debug.LogError(str); weaponitemone1 = Newtonsoft.Json.JsonConvert.DeserializeObject(str); } for (int i = 0; i < toggleprobes.Count; i++) @@ -746,7 +746,7 @@ public class Scenariopage : MonoBehaviour if (ison) { quantity7 += index + ","; - Debug.Log(quantity7); + //Debug.Log(quantity7); } else { @@ -868,15 +868,15 @@ public class Scenariopage : MonoBehaviour } string str = Newtonsoft.Json.JsonConvert.SerializeObject(aircrafts); - Debug.Log(str); + //Debug.Log(str); Dictionary dic = new Dictionary(); dic.Add("data", str); StartCoroutine(PostData2(Url_Updatedevicepara, dic, Two20)); } public void Two20(bool bol, string str) { - Debug.Log(bol); - Debug.Log(str); + //Debug.Log(bol); + //Debug.Log(str); } private void Droneretrieval() { @@ -892,7 +892,7 @@ public class Scenariopage : MonoBehaviour { if (bol) { - Debug.Log(str); + //Debug.Log(str); weaponitemone1 = Newtonsoft.Json.JsonConvert.DeserializeObject(str); } if (weaponitemone1.state) @@ -901,7 +901,7 @@ public class Scenariopage : MonoBehaviour { uavnamelist2.Clear(); } - Debug.Log(weaponitemone1.data.Count); + //Debug.Log(weaponitemone1.data.Count); Toggle1.isOn = false; Toggle2.isOn = false; Toggle3.isOn = false; @@ -1134,15 +1134,15 @@ public class Scenariopage : MonoBehaviour } string str = Newtonsoft.Json.JsonConvert.SerializeObject(aircrafts); - Debug.Log(str); + //Debug.Log(str); Dictionary dic = new Dictionary(); dic.Add("data", str); StartCoroutine(PostData2(Url_Updatedevicepara, dic, One4)); } public void One4(bool bol, string str) { - Debug.Log(bol); - Debug.Log(str); + //Debug.Log(bol); + //Debug.Log(str); } private void Wirelesssearch() @@ -1160,7 +1160,7 @@ public class Scenariopage : MonoBehaviour { if (bol) { - Debug.Log(str); + //Debug.Log(str); weaponitemone1 = Newtonsoft.Json.JsonConvert.DeserializeObject(str); } if (weaponitemone1.state) @@ -1169,7 +1169,7 @@ public class Scenariopage : MonoBehaviour { wirelesslist2.Clear(); } - Debug.Log(weaponitemone1.data.Count); + //Debug.Log(weaponitemone1.data.Count); for (int i = 0; i < weaponitemone1.data.Count; i++) { wirelesslist[i].text = weaponitemone1.data[i].para_name; @@ -1291,15 +1291,15 @@ public class Scenariopage : MonoBehaviour } string str = Newtonsoft.Json.JsonConvert.SerializeObject(aircrafts); - Debug.Log(str); + //Debug.Log(str); Dictionary dic = new Dictionary(); dic.Add("data", str); StartCoroutine(PostData2(Url_Updatedevicepara, dic, getInfo5)); } public void getInfo5(bool bol, string str) { - Debug.Log(bol); - Debug.Log(str); + //Debug.Log(bol); + //Debug.Log(str); } private void Aircraftparameters() { @@ -1316,12 +1316,12 @@ public class Scenariopage : MonoBehaviour Weaponitemone weaponitemone1 = new Weaponitemone(); if (bol) { - Debug.Log(str); + //Debug.Log(str); weaponitemone1 = Newtonsoft.Json.JsonConvert.DeserializeObject(str); } if (weaponitemone1.state) { - Debug.Log(weaponitemone1.data.Count); + //Debug.Log(weaponitemone1.data.Count); for (int i = 0; i < weaponitemone1.data.Count; i++) { Rettalist[i].text = weaponitemone1.data[i].para_name; @@ -1379,19 +1379,19 @@ public class Scenariopage : MonoBehaviour aircraft.para_unit = laserunitlists[i]; aircraft.r1 = Laserunitlist[i].text; //aircraft.r2 = ""; - //aircraft.r3 = ""; k, + //aircraft.r3 = ""; aircrafts.Add(aircraft); } string str = Newtonsoft.Json.JsonConvert.SerializeObject(aircrafts); - Debug.Log(str); + //Debug.Log(str); Dictionary dic = new Dictionary(); dic.Add("data", str); StartCoroutine(PostData2(Url_Updatedevicepara, dic, Two1)); } public void Two1(bool bol, string str) { - Debug.Log(bol); - Debug.Log(str); + //Debug.Log(bol); + //Debug.Log(str); } private void Laserviewing() { @@ -2142,9 +2142,9 @@ public class Scenariopage : MonoBehaviour } datalist.Add(data); } - Debug.Log(datalist); + //Debug.Log(datalist); string datas = Newtonsoft.Json.JsonConvert.SerializeObject(datalist); - Debug.Log(datas); + //Debug.Log(datas); Dictionary dic = new Dictionary(); //dic.Add("action", "adddevice"); dic.Add("think_id", "" + Id + ""); @@ -2153,8 +2153,8 @@ public class Scenariopage : MonoBehaviour } public void getInfo2(bool bol, string str) { - Debug.Log(bol); - Debug.Log(str); + //Debug.Log(bol); + //Debug.Log(str); Chaxun();//查询接口 } @@ -2642,7 +2642,7 @@ public class Scenariopage : MonoBehaviour { - Inquire();//查询接口 + Inquire();//查询设备想定接口 environment_configuration1.gameObject.SetActive(false); object_list_panl.gameObject.SetActive(false); @@ -2762,7 +2762,7 @@ public class Scenariopage : MonoBehaviour Environment.WindDir = "" + winddir + ""; Environment.Light = Slider.value.ToString("f0"); Environment.EnvWu = Foggy_slider.value.ToString("0"); - //Debug.LogError((1 - Slider.value / 10).ToString("f1")); + string res = JsonMapper.ToJson(Environment);//利用插件LitJson将类对象转为json Debug.Log(res); Dictionary formDic = new Dictionary();//用字典保存到对应的想定id里面 @@ -2902,7 +2902,7 @@ public class Scenariopage : MonoBehaviour windamt = "1"; break; } - Debug.LogError(windamt); + //Debug.LogError(windamt); } private void WindDir(float wind) { @@ -3051,10 +3051,10 @@ public class Scenariopage : MonoBehaviour tempEintAmt = 1.0f; break; } - Debug.LogError(tempEintAmt); - Debug.LogError(windDrop.value); + //Debug.LogError(tempEintAmt); + //Debug.LogError(windDrop.value); tenkokuModule.weather_WindAmt = Mathf.Lerp(0.0f, 1.0f, tempEintAmt); - Debug.LogError(tenkokuModule.weather_WindAmt); + //Debug.LogError(tenkokuModule.weather_WindAmt); } diff --git a/Assets/Temp/Scripts/Taskpanel.cs b/Assets/Temp/Scripts/Taskpanel.cs index d0d129f7..127d001e 100644 --- a/Assets/Temp/Scripts/Taskpanel.cs +++ b/Assets/Temp/Scripts/Taskpanel.cs @@ -1,9 +1,6 @@ -using AdamSync; -using System.Collections; -using System.Collections.Generic; using UnityEngine; -using UnityEngine.SceneManagement; using UnityEngine.UI; +using static InterfaceManager; public class Taskpanel : MonoBehaviour { @@ -122,7 +119,13 @@ public class Taskpanel : MonoBehaviour }); guanji_button.onClick.AddListener(() => { - Application.Quit(); + string url = Url_Exit + GlobalFlag.currentUser.login_name; + StartCoroutine(GetString(url, data => + { + Debug.Log(data); + Application.Quit(); + })); + }); menu_button.onClick.AddListener(() => { diff --git a/Assets/Temp/Scripts/View_Panel2.cs b/Assets/Temp/Scripts/View_Panel2.cs index 2e88b8a5..4b252fb4 100644 --- a/Assets/Temp/Scripts/View_Panel2.cs +++ b/Assets/Temp/Scripts/View_Panel2.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -243,8 +243,10 @@ public class View_Panel2 : XUIPanel case "04": case "05": entering_key_btn.gameObject.SetActive(false); - append_btn.interactable = false; - scenario_btn.interactable = false; + //append_btn.interactable = false; + append_btn.gameObject.SetActive(false); + //scenario_btn.interactable = false; + scenario_btn.gameObject.SetActive(false); break; } OnRegisterFunction(); diff --git a/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity b/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity index 8dd503a2..028dce82 100644 --- a/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity +++ b/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 1113159741} - m_IndirectSpecularColor: {r: 0.017637905, g: 0.031211179, b: 0.06785975, a: 1} + m_IndirectSpecularColor: {r: 0.16234729, g: 0.30613518, b: 0.6690394, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -48488,7 +48488,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: -0.000030517578} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 50} m_Pivot: {x: 0.5, y: 1} --- !u!114 &996536657 MonoBehaviour: @@ -53944,6 +53944,7 @@ GameObject: - component: {fileID: 1436809529} - component: {fileID: 1436809534} - component: {fileID: 1436809535} + - component: {fileID: 1436809536} m_Layer: 0 m_Name: Bootstraps m_TagString: Untagged @@ -54116,6 +54117,32 @@ MonoBehaviour: devices: [] isOnlyOne: 1 unmannedAerialVehicleManages: [] +--- !u!114 &1436809536 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1436809528} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 740db79d064790148b2b2fe78986e038, type: 3} + m_Name: + m_EditorClassIdentifier: + DronePosition: DronePosition + SingleDronePosition: SingleDronePosition + WRJExpel: WRJExpel + DroneWasDestroyed: DroneWasDestroyed + WRJDitch: WRJDitch + Planedata: Planedata + Lasing: Lasing + Micow: Micow + SetToBeDestroyed: SetToBeDestroyed + SetToBeDestroyedTwo: SetToBeDestroyedTwo + BandSetting: BandSetting + SweepFrequencyBand: SweepFrequencyBand + KeyTarget: KeyTarget + identification: --- !u!1 &1444599844 GameObject: m_ObjectHideFlags: 0 @@ -67787,7 +67814,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1719983406 RectTransform: m_ObjectHideFlags: 0 @@ -67871,7 +67898,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: -0.000030517578} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 50} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1720385562 MonoBehaviour: @@ -69798,7 +69825,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - randSeed: 401617593 + randSeed: 4767687 isDoingTransition: 0 minimumHeight: 0 --- !u!114 &1820978574 @@ -97959,7 +97986,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -948, y: 10} m_Pivot: {x: 0, y: 1} --- !u!114 &6368481658076565719 MonoBehaviour: @@ -99515,7 +99542,7 @@ RectTransform: m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: 0.5, y: 0.5} @@ -99824,9 +99851,9 @@ RectTransform: m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -7, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &6368481659665436127 MonoBehaviour: diff --git a/Assets/Zion/Scenes/SampleScene.unity b/Assets/Zion/Scenes/SampleScene.unity index beb5a54e..cca88844 100644 --- a/Assets/Zion/Scenes/SampleScene.unity +++ b/Assets/Zion/Scenes/SampleScene.unity @@ -1524,10 +1524,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} + m_ReferenceResolution: {x: 1920, y: 1080} m_ScreenMatchMode: 0 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 diff --git a/Assets/Zion/Scripts/Adam/DragManager.cs b/Assets/Zion/Scripts/Adam/DragManager.cs index 30606b2b..89251df0 100644 --- a/Assets/Zion/Scripts/Adam/DragManager.cs +++ b/Assets/Zion/Scripts/Adam/DragManager.cs @@ -11,7 +11,7 @@ public class DragManager : MonoSingleton { public List deviceimages1 = new List();//把最终场景中存在的模型放入链表当中 public List devices = new List();//把最开始生成在场景中的模型存入链表 - public List modellist = new List();//存入最开始场景生成模型的名字 + public Dictionary model = new Dictionary(); @@ -26,14 +26,7 @@ public class DragManager : MonoSingleton } - //public void AddModeData(string str, GameObject gameObject) - //{ - // GameObject obj = null; - // if (model.TryGetValue(str, out obj)) - // return; - - // model.Add(str, gameObject); - //} + public void AddObj(GameObject obj) { devices.Add(obj);//把生成的预设体放入链表当中 @@ -42,10 +35,7 @@ public class DragManager : MonoSingleton { deviceimages1.Add(obj.GetComponent().modelequipment);//把场景中存在的的模型放入链表当众 } - public void Addtext(string name) - { - modellist.Add(name);//把UI上模型对应的名字存入链表 - } + public void RemoveObj(GameObject obj) { @@ -72,25 +62,4 @@ public class DragManager : MonoSingleton } } -//public class DragManager : MonoSingleton -//{ -// public Deviceimage prefab; - -// start() -// { -// for deviceimages -// Deviceimage d = instance (prefab) -// d.setvalue(Set, De, deviceimages[i].name ,) -// } - -// public void Set() -// { - -// } - -// public void De() -// { - - -// } -//} + diff --git a/Assets/Zion/Scripts/InterfaceManager.cs b/Assets/Zion/Scripts/InterfaceManager.cs index 197a5cc7..74934dfd 100644 --- a/Assets/Zion/Scripts/InterfaceManager.cs +++ b/Assets/Zion/Scripts/InterfaceManager.cs @@ -142,6 +142,10 @@ public static class InterfaceManager /// 删除设备 /// public static string Url_delete { get => IpAddress + "/Handler/Thinkingfile.ashx?action=deletedevice"; } + /// + /// 用户退出 + /// + public static string Url_Exit { get => IpAddress + "/Handler/User.ashx?action=exit&login_name="; } #endregion @@ -151,6 +155,7 @@ public static class InterfaceManager } + public static IEnumerator GetBytes(string url, Action callback) { diff --git a/Assets/Zion/Scripts/MQTT/MQTTManager.cs b/Assets/Zion/Scripts/MQTT/MQTTManager.cs index 92ca4ea0..e849f6c6 100644 --- a/Assets/Zion/Scripts/MQTT/MQTTManager.cs +++ b/Assets/Zion/Scripts/MQTT/MQTTManager.cs @@ -195,7 +195,7 @@ public class MQTTManager : MonoBehaviour Debug.Log($"{$"处理数据{data}"}"); string[] datas = data.Split('$'); if (datas[0] != GlobalFlag.currentUser.user_id) - DeviceManager.Instance.GetSend2roomMsg(data); + DeviceManager.Instance.GetSend2roomMsg(datas[1]); } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 38ed8ea7..d288047c 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -42,8 +42,8 @@ PlayerSettings: m_SplashScreenLogos: [] m_VirtualRealitySplashScreen: {fileID: 0} m_HolographicTrackingLossScreen: {fileID: 0} - defaultScreenWidth: 1080 - defaultScreenHeight: 680 + defaultScreenWidth: 960 + defaultScreenHeight: 540 defaultScreenWidthWeb: 960 defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0