From de255738a9cc96b356caf3776ccfdedc678b9f7f Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Wed, 17 Jan 2024 16:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A0=E4=BA=BA=E6=9C=BA?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefebs/Models/moder/无人机List.prefab | 1 + Assets/Resources/DeviceBtn/WRJ.prefab | 1 + Assets/StreamingAssets/IPPort.txt | 2 +- Assets/StreamingAssets/confing.txt | 2 +- Assets/Temp/Scripts/Scenariopage.cs | 28 +- .../AdamTraining_pilot_terminal_panl 1.unity | 459 +++++++++++++++++- Assets/Zion/Scenes/InitConnect.unity | 2 +- Assets/Zion/Scripts/Adam/DragController.cs | 22 +- Assets/Zion/Scripts/Adam/DragManager.cs | 4 +- Assets/Zion/Scripts/Adam/GameManager.cs | 38 +- Assets/Zion/Scripts/Adam/UIBootstrap.cs | 4 +- Assets/Zion/Scripts/AddConfing.cs | 22 +- Assets/Zion/Scripts/InterfaceManager.cs | 14 +- .../UAV/UnmannedAerialVehicle.cs | 14 +- .../UAV/UnmannedAerialVehicleManage.cs | 28 +- 15 files changed, 559 insertions(+), 82 deletions(-) diff --git a/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab b/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab index 0e44321d..26a1bf4a 100644 --- a/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab +++ b/Assets/GameAssets/Prefebs/Models/moder/无人机List.prefab @@ -310,6 +310,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d7c8a5e37f63c8e419e73f2c1b2ad41e, type: 3} m_Name: m_EditorClassIdentifier: + wrjModel: 0 pattern: 0 interval: 5 equipmentCommon: {fileID: -7238547075891962512} diff --git a/Assets/Resources/DeviceBtn/WRJ.prefab b/Assets/Resources/DeviceBtn/WRJ.prefab index 70ac252f..f47142f9 100644 --- a/Assets/Resources/DeviceBtn/WRJ.prefab +++ b/Assets/Resources/DeviceBtn/WRJ.prefab @@ -182,6 +182,7 @@ MonoBehaviour: deviceID: isPlayer: 0 isThinck: 0 + wrjModel: 0 --- !u!1 &3625114603613546360 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/StreamingAssets/IPPort.txt b/Assets/StreamingAssets/IPPort.txt index a012cbee..298829e4 100644 --- a/Assets/StreamingAssets/IPPort.txt +++ b/Assets/StreamingAssets/IPPort.txt @@ -1 +1 @@ -192.168.138.15: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 87589c67..e56ea71e 100644 --- a/Assets/StreamingAssets/confing.txt +++ b/Assets/StreamingAssets/confing.txt @@ -1 +1 @@ -192.168.138.15 \ No newline at end of file +127.0.0.1 \ No newline at end of file diff --git a/Assets/Temp/Scripts/Scenariopage.cs b/Assets/Temp/Scripts/Scenariopage.cs index 698c48bc..1b722628 100644 --- a/Assets/Temp/Scripts/Scenariopage.cs +++ b/Assets/Temp/Scripts/Scenariopage.cs @@ -1860,15 +1860,15 @@ public class Scenariopage : MonoBehaviour } properties.Clear();//清空链表 } - for (int i = 0; i < DragManager.Instance.deviceimages.Count; i++)//判断单例生成预设体 + for (int i = 0; i < DragManager.Instance.devices.Count; i++)//判断单例生成预设体 { int index = i; - if (DragManager.Instance.deviceimages[i] != null) + if (DragManager.Instance.devices[i] != null) { Propertypanl pro = Instantiate(propertypanl, Panel_making);//生成预设体对象 - pro.Property(DragManager.Instance.deviceimages[i].name.Replace("(Clone)", ""), () => + pro.Property(DragManager.Instance.devices[i].name.Replace("(Clone)", ""), () => { - Destroy(DragManager.Instance.deviceimages[index].gameObject);//删除 + Destroy(DragManager.Instance.devices[index].gameObject);//删除 Destroy(pro.gameObject);//删除 }); properties.Add(pro); @@ -1891,15 +1891,15 @@ public class Scenariopage : MonoBehaviour //想定文件下的保存按钮 save_btn.onClick.AddListener(() => { - if (DragManager.Instance.deviceimages.Count > 0)//判断场景的模型是否为空 + if (DragManager.Instance.devices.Count > 0)//判断场景的模型是否为空 { - for (int i = 0; i < DragManager.Instance.deviceimages.Count; i++) + for (int i = 0; i < DragManager.Instance.devices.Count; i++) { - if (DragManager.Instance.deviceimages[i] != null)//如果链表有模型就进入 + if (DragManager.Instance.devices[i] != null)//如果链表有模型就进入 { - DragManager.Instance.deviceimages[i].GetComponent().SetPos();//初始化获取模型对应位置的值 - DragManager.Instance.Addobj1(DragManager.Instance.deviceimages[i]);//就把对应的模型加到链表类里面 + DragManager.Instance.devices[i].GetComponent().SetPos();//初始化获取模型对应位置的值 + DragManager.Instance.Addobj1(DragManager.Instance.devices[i]);//就把对应的模型加到链表类里面 } } } @@ -1907,16 +1907,16 @@ public class Scenariopage : MonoBehaviour { Passbyvalue();//把场景中天气插件的值传给接口 } - if (DragManager.Instance.deviceimages.Count > 0)//判断模型列表个数是否大于零 + if (DragManager.Instance.devices.Count > 0)//判断模型列表个数是否大于零 { - for (int i = 0; i < DragManager.Instance.deviceimages.Count; i++) + for (int i = 0; i < DragManager.Instance.devices.Count; i++) { - if (DragManager.Instance.deviceimages[i] != null)//如果链表里有一个物体就进去 + if (DragManager.Instance.devices[i] != null)//如果链表里有一个物体就进去 { - Destroy(DragManager.Instance.deviceimages[i].gameObject);//删除链表有的物体 + Destroy(DragManager.Instance.devices[i].gameObject);//删除链表有的物体 } } - DragManager.Instance.deviceimages.Clear();//清空链表 + DragManager.Instance.devices.Clear();//清空链表 } if (DragManager.Instance.modellist.Count > 0) { diff --git a/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity b/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity index 69e4e1d7..ed8352b6 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.16234875, g: 0.30616775, b: 0.6691979, a: 1} + m_IndirectSpecularColor: {r: 0.16235185, g: 0.30592543, b: 0.6678616, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -6651,6 +6651,7 @@ MonoBehaviour: deviceID: isPlayer: 0 isThinck: 0 + wrjModel: 0 --- !u!224 &138577124 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 1586417955185665353, guid: 18a1ad49a084edc44b006d5905c6d928, @@ -19400,6 +19401,153 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 404543400} m_CullTransparentMesh: 0 +--- !u!1001 &405465595 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1744702645} + m_Modifications: + - target: {fileID: 3625114602127132433, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Text + value: "\u7535\u5B50\u4FA6\u5BDF\u65E0\u4EBA\u673A" + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075994, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Name + value: WRJ (1) + objectReference: {fileID: 0} + - target: {fileID: 3625114603413174334, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: wrjModel + value: 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 504e1e72e287c0740a66218ad23fbd0e, type: 3} +--- !u!224 &405465596 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + m_PrefabInstance: {fileID: 405465595} + m_PrefabAsset: {fileID: 0} +--- !u!114 &405465597 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3625114603413174334, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + m_PrefabInstance: {fileID: 405465595} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 154ea33a68384034b8bef474a9a6440d, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &409371466 GameObject: m_ObjectHideFlags: 0 @@ -36388,6 +36536,153 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1001 &627365902 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1744702645} + m_Modifications: + - target: {fileID: 3625114602127132433, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Text + value: "\u81EA\u6740\u5F0F\u65E0\u4EBA\u673A" + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075994, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Name + value: WRJ (2) + objectReference: {fileID: 0} + - target: {fileID: 3625114603413174334, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: wrjModel + value: 3 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 504e1e72e287c0740a66218ad23fbd0e, type: 3} +--- !u!224 &627365903 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + m_PrefabInstance: {fileID: 627365902} + m_PrefabAsset: {fileID: 0} +--- !u!114 &627365904 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3625114603413174334, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + m_PrefabInstance: {fileID: 627365902} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 154ea33a68384034b8bef474a9a6440d, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &628518900 GameObject: m_ObjectHideFlags: 0 @@ -48376,6 +48671,153 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1371902099} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &1378953170 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1744702645} + m_Modifications: + - target: {fileID: 3625114602127132433, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Text + value: "\u5149\u5B66\u4FA6\u5BDF\u65E0\u4EBA\u673A" + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3625114603376075994, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: m_Name + value: WRJ + objectReference: {fileID: 0} + - target: {fileID: 3625114603413174334, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + propertyPath: wrjModel + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 504e1e72e287c0740a66218ad23fbd0e, type: 3} +--- !u!224 &1378953171 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 3625114603376075993, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + m_PrefabInstance: {fileID: 1378953170} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1378953172 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3625114603413174334, guid: 504e1e72e287c0740a66218ad23fbd0e, + type: 3} + m_PrefabInstance: {fileID: 1378953170} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 154ea33a68384034b8bef474a9a6440d, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1388943276 GameObject: m_ObjectHideFlags: 0 @@ -48950,7 +49392,15 @@ MonoBehaviour: Teacher: {fileID: 754191141} student: {fileID: 1862065805184089353} posture: {fileID: 1719983405} + wrjCount: 0 players: [] + gxWRJIds: [] + otherWRJIDs: [] + wrjIDs: [] + wrjDrags: + - {fileID: 1378953172} + - {fileID: 405465597} + - {fileID: 627365904} --- !u!4 &1436809530 Transform: m_ObjectHideFlags: 0 @@ -61771,7 +62221,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 1378953171} + - {fileID: 405465596} + - {fileID: 627365903} m_Father: {fileID: 1913435859} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -63114,7 +63567,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - randSeed: 2139429468 + randSeed: 1015000 isDoingTransition: 0 minimumHeight: 0 --- !u!114 &1820978574 diff --git a/Assets/Zion/Scenes/InitConnect.unity b/Assets/Zion/Scenes/InitConnect.unity index 6de11f35..e6684906 100644 --- a/Assets/Zion/Scenes/InitConnect.unity +++ b/Assets/Zion/Scenes/InitConnect.unity @@ -219,8 +219,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 2132962759} - - component: {fileID: 2132962758} - component: {fileID: 2132962760} + - component: {fileID: 2132962758} m_Layer: 0 m_Name: Net m_TagString: Untagged diff --git a/Assets/Zion/Scripts/Adam/DragController.cs b/Assets/Zion/Scripts/Adam/DragController.cs index de360b63..7e5ea26d 100644 --- a/Assets/Zion/Scripts/Adam/DragController.cs +++ b/Assets/Zion/Scripts/Adam/DragController.cs @@ -16,8 +16,18 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler, public string deviceID; public bool isPlayer = false; public bool isThinck = false; + + public WRJModel wrjModel = WRJModel.无人机; + public void OnBeginDrag(PointerEventData eventData) { + if (isDragWRJ) + { + if (DragManager.Instance.devices.Count == GameManager.Instance.wrjCount) + { + return; + } + } if (model == null) { model = Instantiate(prefabItem); @@ -41,14 +51,18 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler, { if (!isThinck) { + model.GetComponent().isPlayer = true; model.GetComponent().isStartRehearsing = GlobalFlag.isStartRehearsing; List temp = UIBootstrap.Instance.GetListParaItemById(deviceID); model.GetComponent().FillInTheData(temp); - // - // - transform.SetAsLastSibling(); - transform.localScale = Vector3.zero; + if (model.GetComponent()) + model.GetComponent().wrjModel = wrjModel; + if (!isDragWRJ) + { + transform.SetAsLastSibling(); + transform.localScale = Vector3.zero; + } } if (DragManager.Instance != null) { diff --git a/Assets/Zion/Scripts/Adam/DragManager.cs b/Assets/Zion/Scripts/Adam/DragManager.cs index 79e1f13e..cd158b79 100644 --- a/Assets/Zion/Scripts/Adam/DragManager.cs +++ b/Assets/Zion/Scripts/Adam/DragManager.cs @@ -10,7 +10,7 @@ using XFrame.Core.Utils; public class DragManager : MonoSingleton { public List deviceimages1 = new List();//把最终场景中存在的模型放入链表当中 - public List deviceimages = new List();//把最开始生成在场景中的模型存入链表 + public List devices = new List();//把最开始生成在场景中的模型存入链表 public List modellist = new List();//存入最开始场景生成模型的名字 public Dictionary model = new Dictionary(); @@ -36,7 +36,7 @@ public class DragManager : MonoSingleton //} public void AddObj(GameObject obj) { - deviceimages.Add(obj);//把生成的预设体放入链表当中 + devices.Add(obj);//把生成的预设体放入链表当中 } public void Addobj1(GameObject obj) { diff --git a/Assets/Zion/Scripts/Adam/GameManager.cs b/Assets/Zion/Scripts/Adam/GameManager.cs index e5a4eca7..b7cd96be 100644 --- a/Assets/Zion/Scripts/Adam/GameManager.cs +++ b/Assets/Zion/Scripts/Adam/GameManager.cs @@ -4,6 +4,7 @@ using RDate; using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using Tenkoku.Core; using UnityEngine; using static InterfaceManager; @@ -27,7 +28,14 @@ public class GameManager : MonoSingleton public GameObject Teacher; public GameObject student; public GameObject posture; + public int wrjCount; public List players = new List(); + + + public DragController[] wrjDrags; + + + // Start is called before the first frame update private void Awake() { @@ -45,18 +53,30 @@ public class GameManager : MonoSingleton spt.gameObject.SetActive(true); spt.GetComponent().cullingMask = ~(1 << 12); spt.GetComponent().cullingMask = ~(1 << 15); - if (UIBootstrap.Instance.GetDeviceByName("蜂群无人机").device_count > 0) + AdamThinkDevicesData.DataItem diTemp = UIBootstrap.Instance.GetDeviceByName("蜂群无人机"); + if (diTemp.device_count > 0) { - for (int i = 0; i < UIBootstrap.Instance.GetDeviceByName("蜂群无人机").device_count; i++) + wrjCount = diTemp.device_count; + for (int i = 0; i < wrjDrags.Length; i++) { - DragController wrj = Instantiate(wrjDrag, dviceContent); - wrj.isPlayer = true; - wrj.deviceID = UIBootstrap.Instance.GetDeviceByName("蜂群无人机").id; + wrjDrags[i].isPlayer = true; + wrjDrags[i].deviceID = UIBootstrap.Instance.GetDeviceByName("蜂群无人机").id; + } + } + for (int i = 0; i < diTemp.list_para.Count; i++) + { + if (diTemp.list_para[i].para_name.Contains("光学侦察能力") && diTemp.list_para[i].para_value == "1") + { + wrjDrags[0].gameObject.SetActive(false); } } } else { + for (int i = 0; i < dviceContent.childCount; i++) + { + Destroy(dviceContent.GetChild(i).gameObject); + } spt.transform.position = blueSpawnPos.position; spt.transform.eulerAngles = blueSpawnPos.eulerAngles; spt.gameObject.SetActive(true); @@ -328,7 +348,7 @@ public class GameManager : MonoSingleton SpawnDevice(hpDrag.prefabItem, deviceData.data[i]); break; case "频谱探测": - SpawnDevice(ppDrag.prefabItem,deviceData.data[i]); + SpawnDevice(ppDrag.prefabItem, deviceData.data[i]); break; case "微波武器": SpawnDevice(wbDrag.prefabItem, deviceData.data[i]); @@ -355,7 +375,7 @@ public class GameManager : MonoSingleton device.GetComponent().deviceID = data.id; device.GetComponent().FillInTheData(data.list_para); } - + private void OnGetRoomUsers(string obj) { if (!string.IsNullOrWhiteSpace(obj)) @@ -400,8 +420,8 @@ public class GameManager : MonoSingleton tenkokuModule.weather_SnowAmt = Mathf.Lerp(0f, 1f, float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvSnow)); tenkokuModule.weather_WindAmt = Mathf.Lerp(0f, 1f, float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvWindSpeed)); tenkokuModule.weather_WindDir = Mathf.Lerp(0f, 360f, float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvWindDir)); - tenkokuModule.weather_OvercastAmt = Mathf.Lerp(0f, 1f, 1-(float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvLight)/10)); - tenkokuModule.weather_humidity = Mathf.Lerp(0f, 1f,1- (float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvWu) / 100)); + tenkokuModule.weather_OvercastAmt = Mathf.Lerp(0f, 1f, 1 - (float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvLight) / 10)); + tenkokuModule.weather_humidity = Mathf.Lerp(0f, 1f, 1 - (float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvWu) / 100)); Debug.LogError(tenkokuModule.weather_humidity); Debug.LogError(tenkokuModule.weather_OvercastAmt); } diff --git a/Assets/Zion/Scripts/Adam/UIBootstrap.cs b/Assets/Zion/Scripts/Adam/UIBootstrap.cs index c8d731b8..c533b562 100644 --- a/Assets/Zion/Scripts/Adam/UIBootstrap.cs +++ b/Assets/Zion/Scripts/Adam/UIBootstrap.cs @@ -9,7 +9,7 @@ using static InterfaceManager; public class UIBootstrap : MonoSingleton { //private string url = Url_GetAllThinkData; - private string sceneInfoUrl = Url_GetSceneInfo; + private string sceneInfoUrl; public Editinformation editinformation = new Editinformation(); public SceneRoot currentSceneInfo = new SceneRoot(); public List subjectInfo = new List(); @@ -21,6 +21,8 @@ public class UIBootstrap : MonoSingleton // Start is called before the first frame update private async void Start() { + sceneInfoUrl = Url_GetSceneInfo; + Debug.LogError(Url_GetAllThinkData); editinformation = await AsyncWebReq.Post(Url_GetAllThinkData, null); for (int i = 0; i < editinformation.data.Count; i++) { diff --git a/Assets/Zion/Scripts/AddConfing.cs b/Assets/Zion/Scripts/AddConfing.cs index b64fbad2..ac2ab260 100644 --- a/Assets/Zion/Scripts/AddConfing.cs +++ b/Assets/Zion/Scripts/AddConfing.cs @@ -1,4 +1,5 @@ -using System; +using AdamSync; +using System; using System.Collections; using System.Collections.Generic; using System.IO; @@ -16,18 +17,13 @@ public class AddConfing : MonoBehaviour private void Awake() { - StartCoroutine(GetSetting(ipSetting, (data) => - { - string[] datas= data.ToString().Split(':'); - //Debug.Log(IP); - //Debug.Log(Port); - //Debug.Log(Url_Action); - IP = datas[0]; - Port = datas[1]; - //Debug.Log(IP); - //Debug.Log(Port); - //Debug.Log(Url_Action); - })); + string[] datas = ContectServer.ReadFromLocal("IPPort.txt").Split(':'); + //Debug.Log(IP); + //Debug.Log(Port); + //Debug.Log(Url_Action); + IP = datas[0]; + Port = datas[1]; + } diff --git a/Assets/Zion/Scripts/InterfaceManager.cs b/Assets/Zion/Scripts/InterfaceManager.cs index d9112dbb..22cebe1f 100644 --- a/Assets/Zion/Scripts/InterfaceManager.cs +++ b/Assets/Zion/Scripts/InterfaceManager.cs @@ -9,7 +9,7 @@ using Newtonsoft.Json.Linq; public static class InterfaceManager { - private static string _IP = "172.16.1.118"; + private static string _IP; public static string IP { get { return _IP; } @@ -19,7 +19,7 @@ public static class InterfaceManager _IP = value; } } - private static string _Port = "48888"; + private static string _Port; public static string Port { get { return _Port; } @@ -100,7 +100,7 @@ public static class InterfaceManager /// /// 获取房间ID并添加房间 /// - public static string Url_GetRoomID{get => IpAddress + "/Handler/Practice.ashx?action=add&Name=";} + public static string Url_GetRoomID { get => IpAddress + "/Handler/Practice.ashx?action=add&Name="; } /// /// 更新房间状态 /// @@ -142,7 +142,7 @@ public static class InterfaceManager using (System.IO.StreamReader reader = new System.IO.StreamReader(path)) { return reader.ReadToEnd(); } } - + public static IEnumerator GetBytes(string url, Action callback) { @@ -221,10 +221,10 @@ public static class InterfaceManager } } - - + + public static IEnumerator PostString(string url, WWWForm formdata, Dictionary headers = null, Action callback = null) { @@ -279,7 +279,7 @@ public static class InterfaceManager } } - public static IEnumerator GetString(string url, Dictionary headers = null,int time=50,Action callback = null) + public static IEnumerator GetString(string url, Dictionary headers = null, int time = 50, Action callback = null) { while (true) { diff --git a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicle.cs b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicle.cs index fe238e3e..ea85756d 100644 --- a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicle.cs +++ b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicle.cs @@ -13,6 +13,7 @@ using Newtonsoft.Json; /// public class UnmannedAerialVehicle : MonoBehaviour { + public WRJModel wrjModel = WRJModel.无人机; /// /// 所属无人机蜂群 /// @@ -70,9 +71,6 @@ public class UnmannedAerialVehicle : MonoBehaviour /// public GameObject explodePrefab; - - - private void OnTriggerEnter(Collider other) { @@ -85,6 +83,16 @@ public class UnmannedAerialVehicle : MonoBehaviour } } + /// + /// 设置无人机类型 + /// + /// + public void SetWRJModel(WRJModel _wrjModel) + { + wrjModel = _wrjModel; + } + + /// /// 被攻击 /// diff --git a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs index 056bd70a..10f5057e 100644 --- a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs +++ b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs @@ -20,11 +20,12 @@ public enum WRJModel /// public class UnmannedAerialVehicleManage : MonoBehaviour { + public WRJModel wrjModel = WRJModel.无人机; /// /// 无人机状态 /// public Pattern pattern = Pattern.待机; - public WRJModel wrjModel = WRJModel.无人机; + public static List unmannedAerialVehicleManages = new List(); #region 启动暂停 private bool _isStartRehearsing = false; @@ -149,25 +150,6 @@ public class UnmannedAerialVehicleManage : MonoBehaviour OnActivationChanged += OnActivationChangedHandler; } - /// - /// 设置无人机类型 - /// - /// - public void SetWRJModel() - { - switch (wrjModel) - { - case WRJModel.光学无人机: - Debug.Log("光学无人机"); - break; - case WRJModel.电子侦察无人机: - Debug.Log("电子侦察无人机"); - break; - case WRJModel.自杀式无人机: - Debug.Log("自杀式无人机"); - break; - } - } [ContextMenu("Test")] public void Test() @@ -196,7 +178,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour break; } - var _unmannedAerialVehicle = unmannedAerialVehicles.FindAll(x => x != null); + var _unmannedAerialVehicle = unmannedAerialVehicles.FindAll(x => x != null&&x.gameObject.activeInHierarchy); if (_unmannedAerialVehicle.Count == 0) { string nowData = string.Format("{0},{1}", "SetToBeDestroyed", equipmentCommon.deviceID); @@ -282,7 +264,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour isEngagedTarget = true; colliders1.ForEach(x => Debug.Log(x.transform.name)); int _number = UnityEngine.Random.Range(0, colliders1.Count - 1); - List _unmannedAerialVehicles = unmannedAerialVehicles.FindAll(x => x != null); + List _unmannedAerialVehicles = unmannedAerialVehicles.FindAll(x => x != null&&x.gameObject.activeInHierarchy); SendMsg(colliders1[_number].transform); for (int i = 0; i < _unmannedAerialVehicles.Count; i++) { @@ -467,7 +449,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour unmannedAerialVehicles[i].dataLinkCommunicationFrequency = dataLinkCommunicationFrequency; unmannedAerialVehicles[i].electronicReconnaissanceCapability = electronicReconnaissanceCapability; unmannedAerialVehicles[i].opticalReconnaissanceCapability = opticalReconnaissanceCapability; - + unmannedAerialVehicles[i].wrjModel = wrjModel; } } }