This commit is contained in:
		
							parent
							
								
									cee0f3d5cb
								
							
						
					
					
						commit
						1b3c6cb821
					
				|  | @ -75,6 +75,8 @@ MonoBehaviour: | ||||||
|   InterferenceDistance: 1 |   InterferenceDistance: 1 | ||||||
|   detectionRadius: 1000 |   detectionRadius: 1000 | ||||||
|   interval: 2 |   interval: 2 | ||||||
|  |   explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1, | ||||||
|  |     type: 3} | ||||||
| --- !u!65 &7099352370737318148 | --- !u!65 &7099352370737318148 | ||||||
| BoxCollider: | BoxCollider: | ||||||
|   m_ObjectHideFlags: 0 |   m_ObjectHideFlags: 0 | ||||||
|  |  | ||||||
|  | @ -9959,6 +9959,7 @@ MonoBehaviour: | ||||||
|   deviceID:  |   deviceID:  | ||||||
|   explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1, |   explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1, | ||||||
|     type: 3} |     type: 3} | ||||||
|  |   isMove: 1 | ||||||
| --- !u!65 &7615181139496386334 | --- !u!65 &7615181139496386334 | ||||||
| BoxCollider: | BoxCollider: | ||||||
|   m_ObjectHideFlags: 0 |   m_ObjectHideFlags: 0 | ||||||
|  | @ -10014,6 +10015,8 @@ MonoBehaviour: | ||||||
|   InnerLaserlineRenderer: {fileID: 0} |   InnerLaserlineRenderer: {fileID: 0} | ||||||
|   OuterLaserlineRenderer: {fileID: 0} |   OuterLaserlineRenderer: {fileID: 0} | ||||||
|   FireSpeed: 20 |   FireSpeed: 20 | ||||||
|  |   explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1, | ||||||
|  |     type: 3} | ||||||
| --- !u!114 &7615181139496386323 | --- !u!114 &7615181139496386323 | ||||||
| MonoBehaviour: | MonoBehaviour: | ||||||
|   m_ObjectHideFlags: 0 |   m_ObjectHideFlags: 0 | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| 127.0.0.1 | 192.168.6.15 | ||||||
|  | @ -6,7 +6,7 @@ using UnityEngine.UI; | ||||||
| using static InterfaceManager; | using static InterfaceManager; | ||||||
| public class Login_panl : MonoBehaviour | public class Login_panl : MonoBehaviour | ||||||
| { | { | ||||||
|     string url = UrlLogin;//wed端的地址 |     //string url = UrlLogin;//wed端的地址 | ||||||
|     [SerializeField]//外界的类拿不到信息 |     [SerializeField]//外界的类拿不到信息 | ||||||
|     public UserInfo user = new UserInfo(); |     public UserInfo user = new UserInfo(); | ||||||
| 
 | 
 | ||||||
|  | @ -59,7 +59,7 @@ public class Login_panl : MonoBehaviour | ||||||
| 
 | 
 | ||||||
|             string account = username_input.text; |             string account = username_input.text; | ||||||
|             string password = password_input.text; |             string password = password_input.text; | ||||||
|             string url = this.url + "/Handler/User.ashx?action=login"; |             string url = IpAddress + "/Handler/User.ashx?action=login"; | ||||||
|             url += "&login_name="; |             url += "&login_name="; | ||||||
|             url += account; |             url += account; | ||||||
|             url += "&password="; |             url += "&password="; | ||||||
|  |  | ||||||
|  | @ -53,8 +53,8 @@ public class View_Panel2 : XUIPanel | ||||||
|     public List<Button> buttonlist = new List<Button>();//克隆出来房间按钮 |     public List<Button> buttonlist = new List<Button>();//克隆出来房间按钮 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     public string roomUrl = Url_RoomList; |     //public string roomUrl = Url_RoomList; | ||||||
|     public string userUrl = Url_StudentList; |     //public string userUrl = Url_StudentList; | ||||||
|     public RoomData roomdata = new RoomData(); |     public RoomData roomdata = new RoomData(); | ||||||
| 
 | 
 | ||||||
|     public UserData userData = new UserData(); |     public UserData userData = new UserData(); | ||||||
|  | @ -260,7 +260,7 @@ public class View_Panel2 : XUIPanel | ||||||
|     } |     } | ||||||
|     public async void GetAllRoomData() |     public async void GetAllRoomData() | ||||||
|     { |     { | ||||||
|         roomdata = await AsyncWebReq.Post<RoomData>(roomUrl, null); |         roomdata = await AsyncWebReq.Post<RoomData>(Url_RoomList, null); | ||||||
|         UIBootstrap.Instance.SetRoomdata(roomdata); |         UIBootstrap.Instance.SetRoomdata(roomdata); | ||||||
|         if (place.childCount > 0) |         if (place.childCount > 0) | ||||||
|         { |         { | ||||||
|  | @ -274,7 +274,7 @@ public class View_Panel2 : XUIPanel | ||||||
| 
 | 
 | ||||||
|     public async void GetAllUserData() |     public async void GetAllUserData() | ||||||
|     { |     { | ||||||
|         userData = await AsyncWebReq.Post<UserData>(userUrl, null); |         userData = await AsyncWebReq.Post<UserData>(Url_StudentList, null); | ||||||
|     } |     } | ||||||
|     public List<GameObject> currentAllAccount = new List<GameObject>(); |     public List<GameObject> currentAllAccount = new List<GameObject>(); | ||||||
|     public void CreateAllUser(List<DataItem> userInfo) |     public void CreateAllUser(List<DataItem> userInfo) | ||||||
|  |  | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -8,7 +8,7 @@ using static InterfaceManager; | ||||||
| 
 | 
 | ||||||
| public class UIBootstrap : MonoSingleton<UIBootstrap> | public class UIBootstrap : MonoSingleton<UIBootstrap> | ||||||
| { | { | ||||||
|     private string url = Url_GetAllThinkData; |     //private string url = Url_GetAllThinkData; | ||||||
|     private string sceneInfoUrl = Url_GetSceneInfo; |     private string sceneInfoUrl = Url_GetSceneInfo; | ||||||
|     public Editinformation editinformation = new Editinformation(); |     public Editinformation editinformation = new Editinformation(); | ||||||
|     public SceneRoot currentSceneInfo = new SceneRoot(); |     public SceneRoot currentSceneInfo = new SceneRoot(); | ||||||
|  | @ -21,7 +21,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap> | ||||||
|     // Start is called before the first frame update |     // Start is called before the first frame update | ||||||
|     private async void Start() |     private async void Start() | ||||||
|     { |     { | ||||||
|         editinformation = await AsyncWebReq.Post<Editinformation>(url, null); |         editinformation = await AsyncWebReq.Post<Editinformation>(Url_GetAllThinkData, null); | ||||||
|         for (int i = 0; i < editinformation.data.Count; i++) |         for (int i = 0; i < editinformation.data.Count; i++) | ||||||
|         { |         { | ||||||
|             Traininginformation t = new Traininginformation(); |             Traininginformation t = new Traininginformation(); | ||||||
|  |  | ||||||
|  | @ -127,7 +127,7 @@ public static class InterfaceManager | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     public static string Url_AddDeviceAndGetDeviceId { get => IpAddress + "/Handler/Thinkingfile.ashx?action=addpracticedevicedetail"; } |     public static string Url_AddDeviceAndGetDeviceId { get => IpAddress + "/Handler/Thinkingfile.ashx?action=addpracticedevicedetail"; } | ||||||
| 
 | 
 | ||||||
|     public static string UrlLogin { get => "http://111.229.30.246:48888"; } |     //public static string UrlLogin { get => IpAddress+"http://111.229.30.246:48888"; } | ||||||
|     #endregion |     #endregion | ||||||
| 
 | 
 | ||||||
|     public static string GetLocalTxt(string path) |     public static string GetLocalTxt(string path) | ||||||
|  |  | ||||||
|  | @ -87,6 +87,11 @@ public class LaserFireControlPlatformManger : MonoBehaviour | ||||||
|     //private Vector3 laserEndPoint = Vector3.zero; |     //private Vector3 laserEndPoint = Vector3.zero; | ||||||
|     public float FireSpeed = 20.0f;//激光速度 |     public float FireSpeed = 20.0f;//激光速度 | ||||||
|     #endregion |     #endregion | ||||||
|  | 
 | ||||||
|  |     /// <summary> | ||||||
|  |     /// 爆炸预制体 | ||||||
|  |     /// </summary> | ||||||
|  |     public GameObject explodePrefab; | ||||||
|     // Start is called before the first frame update |     // Start is called before the first frame update | ||||||
|     void Start() |     void Start() | ||||||
|     { |     { | ||||||
|  | @ -219,12 +224,35 @@ public class LaserFireControlPlatformManger : MonoBehaviour | ||||||
|         UnmannedAerialVehicle unmannedAerialVehicle = hit.GetComponent<UnmannedAerialVehicle>(); |         UnmannedAerialVehicle unmannedAerialVehicle = hit.GetComponent<UnmannedAerialVehicle>(); | ||||||
|         if (unmannedAerialVehicle) |         if (unmannedAerialVehicle) | ||||||
|         { |         { | ||||||
|             unmannedAerialVehicle.BeAssaulted("激光打击"); |             //unmannedAerialVehicle.BeAssaulted("激光打击"); | ||||||
| 
 |             AddBao(unmannedAerialVehicle); | ||||||
|             StartCoroutine(LaserExtinction()); |             StartCoroutine(LaserExtinction()); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /// <summary> | ||||||
|  |     /// 销毁单体无人机 | ||||||
|  |     /// </summary> | ||||||
|  |     public void AddBao(UnmannedAerialVehicle unmannedAerialVehicle) | ||||||
|  |     { | ||||||
|  |         string nowData = GetSyncDis(unmannedAerialVehicle); | ||||||
|  |         Debug.Log(nowData); | ||||||
|  |         DeviceManager.Instance.send2roomStr.Enqueue(nowData); | ||||||
|  |         GameObject Bao = Instantiate(explodePrefab, unmannedAerialVehicle.transform); | ||||||
|  |         Bao.transform.localPosition = Vector3.zero; | ||||||
|  |         Bao.transform.SetParent(null); | ||||||
|  |         Bao.SetActive(true); | ||||||
|  |         Destroy(unmannedAerialVehicle.gameObject); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /// <summary> | ||||||
|  |     /// 单个无人机被销毁 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     protected string GetSyncDis(UnmannedAerialVehicle unmannedAerialVehicle) | ||||||
|  |     { | ||||||
|  |         return string.Format("{0},{1},{2}", "DroneWasDestroyed", unmannedAerialVehicle.unmannedAerialVehicleManage.equipmentCommon.deviceID, unmannedAerialVehicle.serialNumber); | ||||||
|  |     } | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     /// 隐藏激光 |     /// 隐藏激光 | ||||||
|     /// </summary> |     /// </summary> | ||||||
|  |  | ||||||
|  | @ -3,6 +3,7 @@ using System.Collections.Generic; | ||||||
| using UnityEngine; | using UnityEngine; | ||||||
| using AdamThinkDevicesData; | using AdamThinkDevicesData; | ||||||
| using AdamSync; | using AdamSync; | ||||||
|  | using DG.Tweening; | ||||||
| 
 | 
 | ||||||
| /// <summary> | /// <summary> | ||||||
| /// 地面无线电干扰控制 | /// 地面无线电干扰控制 | ||||||
|  | @ -72,6 +73,11 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     public float interval = 5.0f; |     public float interval = 5.0f; | ||||||
|     #endregion |     #endregion | ||||||
|  | 
 | ||||||
|  |     /// <summary> | ||||||
|  |     /// 爆炸预制体 | ||||||
|  |     /// </summary> | ||||||
|  |     public GameObject explodePrefab; | ||||||
|     // Start is called before the first frame update |     // Start is called before the first frame update | ||||||
|     void Start() |     void Start() | ||||||
|     { |     { | ||||||
|  | @ -83,7 +89,17 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour | ||||||
|     // Update is called once per frame |     // Update is called once per frame | ||||||
|     void Update() |     void Update() | ||||||
|     { |     { | ||||||
|         |         if (unmannedAerialVehicles.Count > 0 && isDo) | ||||||
|  |         { | ||||||
|  |             isDo = false; | ||||||
|  |             UnmannedAerialVehicle unmannedAerialVehicle = unmannedAerialVehicles.Dequeue(); | ||||||
|  |             Vector3 _pos = unmannedAerialVehicle.transform.position - new Vector3(0, 50, 0); | ||||||
|  |             unmannedAerialVehicle.transform.LookAt(_pos); | ||||||
|  |             unmannedAerialVehicle.transform.DOMove(_pos, 1).OnComplete(() => | ||||||
|  |             { | ||||||
|  |                 AddBao(unmannedAerialVehicle); | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     #region  启动暂停 |     #region  启动暂停 | ||||||
|     /// <summary> |     /// <summary> | ||||||
|  | @ -197,13 +213,41 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour | ||||||
|                     if(unmannedAerialVehicle.dataLinkCommunicationFrequency== InterferingFrequency) |                     if(unmannedAerialVehicle.dataLinkCommunicationFrequency== InterferingFrequency) | ||||||
|                     { |                     { | ||||||
|                         Debug.Log("干扰...:"+ colliders[i].name + "成功。"); |                         Debug.Log("干扰...:"+ colliders[i].name + "成功。"); | ||||||
|                         unmannedAerialVehicle.BeAssaulted("无线电干扰"); |                         //unmannedAerialVehicle.BeAssaulted("无线电干扰"); | ||||||
|  |                         unmannedAerialVehicles.Enqueue(unmannedAerialVehicle); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     Queue<UnmannedAerialVehicle> unmannedAerialVehicles = new Queue<UnmannedAerialVehicle>(); | ||||||
|  | 
 | ||||||
|  |     private bool isDo = true; | ||||||
|  |     /// <summary> | ||||||
|  |     /// 销毁单体无人机 | ||||||
|  |     /// </summary> | ||||||
|  |     public void AddBao(UnmannedAerialVehicle unmannedAerialVehicle) | ||||||
|  |     { | ||||||
|  |         string nowData = GetSyncDis(unmannedAerialVehicle); | ||||||
|  |         Debug.Log(nowData); | ||||||
|  |         DeviceManager.Instance.send2roomStr.Enqueue(nowData); | ||||||
|  |         GameObject Bao = Instantiate(explodePrefab, unmannedAerialVehicle.transform); | ||||||
|  |         Bao.transform.localPosition = Vector3.zero; | ||||||
|  |         Bao.transform.SetParent(null); | ||||||
|  |         Bao.SetActive(true); | ||||||
|  |         Destroy(unmannedAerialVehicle.gameObject); | ||||||
|  |         isDo = true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /// <summary> | ||||||
|  |     /// 单个无人机被销毁 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     protected string GetSyncDis(UnmannedAerialVehicle unmannedAerialVehicle) | ||||||
|  |     { | ||||||
|  |         return string.Format("{0},{1},{2}", "DroneWasDestroyed", unmannedAerialVehicle.unmannedAerialVehicleManage.equipmentCommon.deviceID, unmannedAerialVehicle.serialNumber); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     private void OnDestroy() |     private void OnDestroy() | ||||||
|     { |     { | ||||||
|  |  | ||||||
|  | @ -136,14 +136,6 @@ public class UnmannedAerialVehicle : MonoBehaviour | ||||||
|         Bao.SetActive(true); |         Bao.SetActive(true); | ||||||
|         |         | ||||||
|         Destroy(gameObject); |         Destroy(gameObject); | ||||||
|         // 获取组件 |  | ||||||
|         //Component component = gameObject.GetComponent<BoxCollider>(); |  | ||||||
|         //// 移除组件 |  | ||||||
|         //if (component != null) |  | ||||||
|         //{ |  | ||||||
|         //    Destroy(component); |  | ||||||
|         //    transform.localScale = Vector3.zero; |  | ||||||
|         //} |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /// <summary> |     /// <summary> | ||||||
|  |  | ||||||
|  | @ -523,7 +523,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour | ||||||
|     } |     } | ||||||
|     public IEnumerator MoveObjectAlongPath(Vector3 _positions,bool _isMove) // 协程:按路线移动物体 |     public IEnumerator MoveObjectAlongPath(Vector3 _positions,bool _isMove) // 协程:按路线移动物体 | ||||||
|     { |     { | ||||||
|         Vector3 targetPosition = new Vector3(_positions.x, 150, _positions.z);// 目标位置为当前顶点坐标 |         Vector3 targetPosition = new Vector3(_positions.x, 200, _positions.z);// 目标位置为当前顶点坐标 | ||||||
|         float _distance = Vector3.Distance(transform.position, targetPosition); |         float _distance = Vector3.Distance(transform.position, targetPosition); | ||||||
|         float _time = _distance / FireSpeed; |         float _time = _distance / FireSpeed; | ||||||
|         transform.LookAt(targetPosition); |         transform.LookAt(targetPosition); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue