This commit is contained in:
		
							parent
							
								
									cee0f3d5cb
								
							
						
					
					
						commit
						1b3c6cb821
					
				|  | @ -75,6 +75,8 @@ MonoBehaviour: | |||
|   InterferenceDistance: 1 | ||||
|   detectionRadius: 1000 | ||||
|   interval: 2 | ||||
|   explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1, | ||||
|     type: 3} | ||||
| --- !u!65 &7099352370737318148 | ||||
| BoxCollider: | ||||
|   m_ObjectHideFlags: 0 | ||||
|  |  | |||
|  | @ -9959,6 +9959,7 @@ MonoBehaviour: | |||
|   deviceID:  | ||||
|   explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1, | ||||
|     type: 3} | ||||
|   isMove: 1 | ||||
| --- !u!65 &7615181139496386334 | ||||
| BoxCollider: | ||||
|   m_ObjectHideFlags: 0 | ||||
|  | @ -10014,6 +10015,8 @@ MonoBehaviour: | |||
|   InnerLaserlineRenderer: {fileID: 0} | ||||
|   OuterLaserlineRenderer: {fileID: 0} | ||||
|   FireSpeed: 20 | ||||
|   explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1, | ||||
|     type: 3} | ||||
| --- !u!114 &7615181139496386323 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|  |  | |||
|  | @ -1 +1 @@ | |||
| 127.0.0.1 | ||||
| 192.168.6.15 | ||||
|  | @ -6,7 +6,7 @@ using UnityEngine.UI; | |||
| using static InterfaceManager; | ||||
| public class Login_panl : MonoBehaviour | ||||
| { | ||||
|     string url = UrlLogin;//wed端的地址 | ||||
|     //string url = UrlLogin;//wed端的地址 | ||||
|     [SerializeField]//外界的类拿不到信息 | ||||
|     public UserInfo user = new UserInfo(); | ||||
| 
 | ||||
|  | @ -59,7 +59,7 @@ public class Login_panl : MonoBehaviour | |||
| 
 | ||||
|             string account = username_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 += account; | ||||
|             url += "&password="; | ||||
|  |  | |||
|  | @ -53,8 +53,8 @@ public class View_Panel2 : XUIPanel | |||
|     public List<Button> buttonlist = new List<Button>();//克隆出来房间按钮 | ||||
| 
 | ||||
| 
 | ||||
|     public string roomUrl = Url_RoomList; | ||||
|     public string userUrl = Url_StudentList; | ||||
|     //public string roomUrl = Url_RoomList; | ||||
|     //public string userUrl = Url_StudentList; | ||||
|     public RoomData roomdata = new RoomData(); | ||||
| 
 | ||||
|     public UserData userData = new UserData(); | ||||
|  | @ -260,7 +260,7 @@ public class View_Panel2 : XUIPanel | |||
|     } | ||||
|     public async void GetAllRoomData() | ||||
|     { | ||||
|         roomdata = await AsyncWebReq.Post<RoomData>(roomUrl, null); | ||||
|         roomdata = await AsyncWebReq.Post<RoomData>(Url_RoomList, null); | ||||
|         UIBootstrap.Instance.SetRoomdata(roomdata); | ||||
|         if (place.childCount > 0) | ||||
|         { | ||||
|  | @ -274,7 +274,7 @@ public class View_Panel2 : XUIPanel | |||
| 
 | ||||
|     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 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> | ||||
| { | ||||
|     private string url = Url_GetAllThinkData; | ||||
|     //private string url = Url_GetAllThinkData; | ||||
|     private string sceneInfoUrl = Url_GetSceneInfo; | ||||
|     public Editinformation editinformation = new Editinformation(); | ||||
|     public SceneRoot currentSceneInfo = new SceneRoot(); | ||||
|  | @ -21,7 +21,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap> | |||
|     // Start is called before the first frame update | ||||
|     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++) | ||||
|         { | ||||
|             Traininginformation t = new Traininginformation(); | ||||
|  |  | |||
|  | @ -127,7 +127,7 @@ public static class InterfaceManager | |||
|     /// </summary> | ||||
|     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 | ||||
| 
 | ||||
|     public static string GetLocalTxt(string path) | ||||
|  |  | |||
|  | @ -87,6 +87,11 @@ public class LaserFireControlPlatformManger : MonoBehaviour | |||
|     //private Vector3 laserEndPoint = Vector3.zero; | ||||
|     public float FireSpeed = 20.0f;//激光速度 | ||||
|     #endregion | ||||
| 
 | ||||
|     /// <summary> | ||||
|     /// 爆炸预制体 | ||||
|     /// </summary> | ||||
|     public GameObject explodePrefab; | ||||
|     // Start is called before the first frame update | ||||
|     void Start() | ||||
|     { | ||||
|  | @ -219,12 +224,35 @@ public class LaserFireControlPlatformManger : MonoBehaviour | |||
|         UnmannedAerialVehicle unmannedAerialVehicle = hit.GetComponent<UnmannedAerialVehicle>(); | ||||
|         if (unmannedAerialVehicle) | ||||
|         { | ||||
|             unmannedAerialVehicle.BeAssaulted("激光打击"); | ||||
| 
 | ||||
|             //unmannedAerialVehicle.BeAssaulted("激光打击"); | ||||
|             AddBao(unmannedAerialVehicle); | ||||
|             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> | ||||
|  |  | |||
|  | @ -3,6 +3,7 @@ using System.Collections.Generic; | |||
| using UnityEngine; | ||||
| using AdamThinkDevicesData; | ||||
| using AdamSync; | ||||
| using DG.Tweening; | ||||
| 
 | ||||
| /// <summary> | ||||
| /// 地面无线电干扰控制 | ||||
|  | @ -72,6 +73,11 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour | |||
|     /// </summary> | ||||
|     public float interval = 5.0f; | ||||
|     #endregion | ||||
| 
 | ||||
|     /// <summary> | ||||
|     /// 爆炸预制体 | ||||
|     /// </summary> | ||||
|     public GameObject explodePrefab; | ||||
|     // Start is called before the first frame update | ||||
|     void Start() | ||||
|     { | ||||
|  | @ -83,7 +89,17 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour | |||
|     // Update is called once per frame | ||||
|     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  启动暂停 | ||||
|     /// <summary> | ||||
|  | @ -197,13 +213,41 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour | |||
|                     if(unmannedAerialVehicle.dataLinkCommunicationFrequency== InterferingFrequency) | ||||
|                     { | ||||
|                         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() | ||||
|     { | ||||
|  |  | |||
|  | @ -136,14 +136,6 @@ public class UnmannedAerialVehicle : MonoBehaviour | |||
|         Bao.SetActive(true); | ||||
|         | ||||
|         Destroy(gameObject); | ||||
|         // 获取组件 | ||||
|         //Component component = gameObject.GetComponent<BoxCollider>(); | ||||
|         //// 移除组件 | ||||
|         //if (component != null) | ||||
|         //{ | ||||
|         //    Destroy(component); | ||||
|         //    transform.localScale = Vector3.zero; | ||||
|         //} | ||||
|     } | ||||
| 
 | ||||
|     /// <summary> | ||||
|  |  | |||
|  | @ -523,7 +523,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour | |||
|     } | ||||
|     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 _time = _distance / FireSpeed; | ||||
|         transform.LookAt(targetPosition); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue