using AdamThinkDevicesData; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Microwaveweapon : MonoBehaviour { public EquipmentCommon equipment; #region 微波武器 /// /// 储能间隔时间 /// public string Storageintervaltime; /// /// 毁伤目标累计作用时间 /// public string Microwavedamagetime; /// /// 干扰距离 /// public string Microwaveinterferencedistance; /// /// 干扰角度 /// public string MicrowaveinterferenceAngle; #endregion private bool _isStartRehearsing = false; /// /// 是否演练开关 /// public bool isStartRehearsing { get { return _isStartRehearsing; } set { if (_isStartRehearsing != value) { _isStartRehearsing = value; OnActivationChanged?.Invoke(_isStartRehearsing); } } } public event System.Action OnActivationChanged; void Start() { equipment = GetComponent(); OnActivationChanged += OnActivationChangedHandler; } /// /// 演练是否开始开关 /// void OnActivationChangedHandler(bool bol) { if (bol) { Debug.Log("开始演练"); } else { Debug.Log("暂停演练"); } } /// /// 获取设备的参数 /// public void FillInTheData(List weaponitemone) { for (int i = 0; i < weaponitemone.Count; i++) { switch (weaponitemone[i].para_name) { case "储能间隔时间:": Storageintervaltime = weaponitemone[i].para_value; break; case "毁伤目标累积作用时间:": Microwavedamagetime = weaponitemone[i].para_value; break; case "干扰距离:": Microwaveinterferencedistance = weaponitemone[i].para_value; break; case "干扰角度:": MicrowaveinterferenceAngle = weaponitemone[i].para_value; break; default: break; } } } void Update() { } private void OnDestroy() { OnActivationChanged -= OnActivationChangedHandler; } }