85 lines
2.1 KiB
C#
85 lines
2.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UnmannedAerialVehicleUI : MonoBehaviour
|
|
{
|
|
public static UnmannedAerialVehicleUI Instance;
|
|
/// <summary>
|
|
/// 选中的无人机编队
|
|
/// </summary>
|
|
public UnmannedAerialVehicleManage unmannedAerialVehicleManage;
|
|
/// <summary>
|
|
/// 自身频段设置
|
|
/// </summary>
|
|
public Button btnFrequencyBand;
|
|
/// <summary>
|
|
/// 侦测频段设置
|
|
/// </summary>
|
|
public Button btnSurveillanceFrequencyBand;
|
|
|
|
public void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 切换无人机阵型
|
|
/// </summary>
|
|
/// <param name="number"></param>
|
|
public void AddFormation(int number)
|
|
{
|
|
if (unmannedAerialVehicleManage)
|
|
{
|
|
unmannedAerialVehicleManage.Formation(number);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 航线设置
|
|
/// </summary>
|
|
public void GetRouteSettings(bool isOpen)
|
|
{
|
|
if (unmannedAerialVehicleManage)
|
|
{
|
|
if (isOpen)
|
|
{
|
|
unmannedAerialVehicleManage.RouteSettings();
|
|
if (unmannedAerialVehicleManage.airRoute)
|
|
unmannedAerialVehicleManage.airRoute.transform.localScale = Vector3.one;
|
|
}
|
|
else
|
|
{
|
|
unmannedAerialVehicleManage.TurnOffCourseSettings();
|
|
if (unmannedAerialVehicleManage.airRoute)
|
|
unmannedAerialVehicleManage.airRoute.transform.localScale = Vector3.zero;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
public void SwitchModelScale(float scale)
|
|
{
|
|
transform.localScale = new Vector3(scale, scale, scale);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 切换无人机模式
|
|
/// </summary>
|
|
/// <param name="patternCut"></param>
|
|
public void GetModeSwitch(int patternCut)
|
|
{
|
|
if (unmannedAerialVehicleManage)
|
|
{
|
|
unmannedAerialVehicleManage.modeSwitch(patternCut);
|
|
}
|
|
}
|
|
}
|