Compare commits
No commits in common. "d2b7615a0e9ef3819b34c859b3a0baef5b883841" and "79b303529257e10c3569f7d6e396a703c197ac0b" have entirely different histories.
d2b7615a0e
...
79b3035292
|
|
@ -8,13 +8,13 @@ public class PostureController : MonoBehaviour
|
|||
{
|
||||
public List<EquipmentCommon> redObjs = new List<EquipmentCommon>();
|
||||
public List<EquipmentCommon> blueObjs = new List<EquipmentCommon>();
|
||||
private DeviceManager deviceManager;
|
||||
public DeviceManager deviceManager;
|
||||
public Transform redContanier;
|
||||
public Transform blueContanier;
|
||||
public DeviceBtnItem deviceBtnItem;
|
||||
public RawImage redShowImage;
|
||||
public RawImage blueShowImage;
|
||||
private DroneViewDisplay droneViewDisplay;
|
||||
public DroneViewDisplay droneViewDisplay;
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
|
|
@ -54,28 +54,10 @@ public class PostureController : MonoBehaviour
|
|||
for (int i = 0; i < redObjs.Count; i++)
|
||||
{
|
||||
CreatDeviceItem(redContanier, redObjs[i].name, redObjs[i].deviceID, 0);
|
||||
redObjs[i].onDeviceDelete += RemoveItem;
|
||||
}
|
||||
for (int i = 0; i < blueObjs.Count; i++)
|
||||
{
|
||||
CreatDeviceItem(blueContanier, blueObjs[i].name, blueObjs[i].deviceID, 1);
|
||||
blueObjs[i].onDeviceDelete += RemoveItem;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实时更新设备列表
|
||||
/// </summary>
|
||||
|
||||
public void RemoveItem(string id)
|
||||
{
|
||||
for (int i = 0; i < redObjs.Count; i++)
|
||||
{
|
||||
if (redObjs[i].deviceID == id)
|
||||
{
|
||||
redObjs.Remove(redObjs[i]);
|
||||
return;
|
||||
}
|
||||
CreatDeviceItem(blueContanier, blueObjs[i].name, redObjs[i].deviceID, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +69,6 @@ public class PostureController : MonoBehaviour
|
|||
{
|
||||
OnDeviceBtn(id, redOrBlue);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void OnDeviceBtn(string id, int redOrBlue)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using AdamSync;
|
|||
using Newtonsoft.Json;
|
||||
using static InterfaceManager;
|
||||
using System.Collections;
|
||||
using UnityEngine.Events;
|
||||
|
||||
/// <summary>
|
||||
/// 设备
|
||||
|
|
@ -68,8 +67,6 @@ public class EquipmentCommon : MonoBehaviour
|
|||
/// </summary>
|
||||
public GameObject explodePrefab;
|
||||
|
||||
public UnityAction<string> onDeviceDelete;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||
|
|
@ -81,7 +78,7 @@ public class EquipmentCommon : MonoBehaviour
|
|||
}
|
||||
void Start()
|
||||
{
|
||||
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||
_isStartRehearsing= GlobalFlag.isStartRehearsing;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -175,7 +172,7 @@ public class EquipmentCommon : MonoBehaviour
|
|||
TerrestrialRadioInterferenceManger terrestrialRadioInterferenceManger = GetComponent<TerrestrialRadioInterferenceManger>();
|
||||
terrestrialRadioInterferenceManger.FillInTheData(weaponitemone);
|
||||
terrestrialRadioInterferenceManger.isStartRehearsing = isStartRehearsing;
|
||||
|
||||
|
||||
break;
|
||||
case "蜂群无人机":
|
||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>();
|
||||
|
|
@ -334,7 +331,6 @@ public class EquipmentCommon : MonoBehaviour
|
|||
}
|
||||
break;
|
||||
case "SetToBeDestroyed"://设备被销毁
|
||||
onDeviceDelete?.Invoke(deviceID);
|
||||
GameObject Bao = Instantiate(explodePrefab, transform);
|
||||
Bao.transform.localPosition = Vector3.zero;
|
||||
Bao.transform.SetParent(null);
|
||||
|
|
@ -342,7 +338,6 @@ public class EquipmentCommon : MonoBehaviour
|
|||
Destroy(transform.gameObject);
|
||||
break;
|
||||
case "SetToBeDestroyedTwo"://设备被收回
|
||||
onDeviceDelete?.Invoke(deviceID);
|
||||
Destroy(transform.gameObject);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -207,7 +207,6 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
headers.AddField("id", equipmentCommon.deviceID);
|
||||
StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data =>
|
||||
{
|
||||
equipmentCommon.onDeviceDelete?.Invoke(equipmentCommon.deviceID);
|
||||
//Debug.Log(data);
|
||||
Destroy(gameObject);
|
||||
}));
|
||||
|
|
|
|||
Loading…
Reference in New Issue