93 lines
2.2 KiB
C#
93 lines
2.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Conversionfrequency : MonoBehaviour
|
|
{
|
|
public static Conversionfrequency Instance;
|
|
|
|
public TerrestrialRadioInterferenceManger terrestrialRadioInterferenceManger;
|
|
public Dropdown dropdown;
|
|
public int Smallfrequency;
|
|
/// <summary>
|
|
/// 取消频率设置按钮
|
|
/// </summary>
|
|
public Button offon_buttn;
|
|
/// <summary>
|
|
/// 确认频率按钮
|
|
/// </summary>
|
|
public Button verify_buttn;
|
|
/// <summary>
|
|
/// 调整场景内无线电干扰的频率
|
|
/// </summary>
|
|
public string disturb;
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
void Start()
|
|
{
|
|
transform.gameObject.SetActive(false);
|
|
Controlpage();
|
|
}
|
|
|
|
private void Controlpage()
|
|
{
|
|
offon_buttn.onClick.AddListener(() =>
|
|
{
|
|
transform.gameObject.SetActive(false);
|
|
});
|
|
verify_buttn.onClick.AddListener(() =>
|
|
{
|
|
Smallfrequency = dropdown.value;
|
|
terrestrialRadioInterferenceManger.Interference(Smallfrequency);
|
|
transform.gameObject.SetActive(false);
|
|
});
|
|
}
|
|
|
|
private void Radio()
|
|
{
|
|
switch (dropdown.value)
|
|
{
|
|
case 0:
|
|
disturb = "1227.60 MHz";
|
|
Debug.LogError(disturb);
|
|
break;
|
|
case 1:
|
|
disturb = "1381.05 MHz";
|
|
Debug.LogError(disturb);
|
|
break;
|
|
case 2:
|
|
disturb = "1575.42 MHz";
|
|
Debug.LogError(disturb);
|
|
break;
|
|
case 3:
|
|
disturb = "2GHz";
|
|
Debug.LogError(disturb);
|
|
break;
|
|
case 4:
|
|
disturb = "4GHz";
|
|
Debug.LogError(disturb);
|
|
break;
|
|
case 5:
|
|
disturb = "5GHz";
|
|
Debug.LogError(disturb);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
//Radio();
|
|
//Smallfrequency=dropdown.value;
|
|
}
|
|
private void OnDestroy()
|
|
{
|
|
transform.gameObject.SetActive(false);
|
|
}
|
|
}
|