100 lines
2.6 KiB
C#
100 lines
2.6 KiB
C#
using AdamThinkDevicesData;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Microwaveweapon : MonoBehaviour
|
|
{
|
|
public EquipmentCommon equipment;
|
|
#region 微波武器
|
|
/// <summary>
|
|
/// 储能间隔时间
|
|
/// </summary>
|
|
public string Storageintervaltime;
|
|
/// <summary>
|
|
/// 毁伤目标累计作用时间
|
|
/// </summary>
|
|
public string Microwavedamagetime;
|
|
/// <summary>
|
|
/// 干扰距离
|
|
/// </summary>
|
|
public string Microwaveinterferencedistance;
|
|
/// <summary>
|
|
/// 干扰角度
|
|
/// </summary>
|
|
public string MicrowaveinterferenceAngle;
|
|
#endregion
|
|
|
|
private bool _isStartRehearsing = false;
|
|
/// <summary>
|
|
/// 是否演练开关
|
|
/// </summary>
|
|
public bool isStartRehearsing
|
|
{
|
|
get { return _isStartRehearsing; }
|
|
set
|
|
{
|
|
if (_isStartRehearsing != value)
|
|
{
|
|
_isStartRehearsing = value;
|
|
OnActivationChanged?.Invoke(_isStartRehearsing);
|
|
}
|
|
}
|
|
}
|
|
public event System.Action<bool> OnActivationChanged;
|
|
void Start()
|
|
{
|
|
equipment = GetComponent<EquipmentCommon>();
|
|
|
|
OnActivationChanged += OnActivationChangedHandler;
|
|
}
|
|
/// <summary>
|
|
/// 演练是否开始开关
|
|
/// </summary>
|
|
void OnActivationChangedHandler(bool bol)
|
|
{
|
|
if (bol)
|
|
{
|
|
Debug.Log("开始演练");
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("暂停演练");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 获取设备的参数
|
|
/// </summary>
|
|
public void FillInTheData(List<List_paraItem> 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;
|
|
}
|
|
}
|