You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
public class PersonnelLocationMenuPanel : UIView
|
|
|
|
{
|
|
|
|
public Toggle startToggle;
|
|
|
|
public Button broomButton;
|
|
|
|
public Toggle displayToggle;
|
|
|
|
public Toggle saveToggle;
|
|
|
|
public Button saveButton;
|
|
|
|
|
|
|
|
|
|
|
|
public override void Awake()
|
|
|
|
{
|
|
|
|
base.Awake();
|
|
|
|
|
|
|
|
//开启定位
|
|
|
|
startToggle.onValueChanged.AddListener(v =>
|
|
|
|
{
|
|
|
|
if (v)
|
|
|
|
Main.LocationSimulator.StartLocation();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Main.LocationSimulator.StopLocation();
|
|
|
|
Main.Event.StopLocation();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
//清除数据
|
|
|
|
broomButton.onClick.AddListener(() =>
|
|
|
|
{
|
|
|
|
Main.Event.ClearTrack();
|
|
|
|
});
|
|
|
|
//显示轨迹
|
|
|
|
displayToggle.onValueChanged.AddListener((bool isOn) =>
|
|
|
|
{
|
|
|
|
Main.Event.ShowTrajectories(isOn);
|
|
|
|
});
|
|
|
|
//保存轨迹开关
|
|
|
|
saveToggle.onValueChanged.AddListener(v => Main.LocationSimulator.isSaveHistory = v);
|
|
|
|
//保存轨迹
|
|
|
|
saveButton.onClick.AddListener(() => Main.LocationSimulator.SaveHistoryData());
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Hide()
|
|
|
|
{
|
|
|
|
startToggle.isOn = false;
|
|
|
|
base.Hide();
|
|
|
|
}
|
|
|
|
}
|