diff --git a/Assets/StreamingAssets/IPPort.txt b/Assets/StreamingAssets/IPPort.txt index 56247b8d..298829e4 100644 --- a/Assets/StreamingAssets/IPPort.txt +++ b/Assets/StreamingAssets/IPPort.txt @@ -1 +1 @@ -172.16.1.254: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 3ee323cd..e56ea71e 100644 --- a/Assets/StreamingAssets/confing.txt +++ b/Assets/StreamingAssets/confing.txt @@ -1 +1 @@ -172.16.1.156 \ No newline at end of file +127.0.0.1 \ No newline at end of file diff --git a/Assets/Zion/Scripts/Adam/FormationManager.cs b/Assets/Zion/Scripts/Adam/FormationManager.cs index 69dacb15..7ae22801 100644 --- a/Assets/Zion/Scripts/Adam/FormationManager.cs +++ b/Assets/Zion/Scripts/Adam/FormationManager.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.EventSystems; using UnityEngine.UI; /// @@ -11,7 +12,7 @@ public class FormationManager : MonoBehaviour public Button startFormationBtn; public Button submitFormationBtn; public bool isStartFormation; - + public List uavm = new List(); // Start is called before the first frame update void Start() { @@ -24,9 +25,21 @@ public class FormationManager : MonoBehaviour { if (isStartFormation) { - if (Input.GetKeyDown(KeyCode.LeftControl) && Input.GetMouseButtonDown(0)) + if (Input.GetKey(KeyCode.LeftControl) && Input.GetMouseButtonDown(0)) { - Debug.Log("拾取"); + if (EventSystem.current.IsPointerOverGameObject()) return; + Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); + RaycastHit hitInfo; + if (Physics.Raycast(ray, out hitInfo, 1000)) + { + if (hitInfo.collider.gameObject.tag == "WRJ") + { + if (!uavm.Contains(hitInfo.collider.gameObject.GetComponent())) + uavm.Add(hitInfo.collider.gameObject.GetComponent()); + Debug.Log("拾取"); + } + + } } } } diff --git a/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs b/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs index 0e096de1..ae05e01d 100644 --- a/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs +++ b/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs @@ -14,6 +14,10 @@ public class EquipmentCommon : MonoBehaviour { public EquipmentCommon equipmentCommon; /// + /// 打组ID + /// + public string groupId; + /// /// 场景所在方 /// public SelectedSide selectedSide = SelectedSide.Other;