162 lines
5.5 KiB
C#
162 lines
5.5 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using static InterfaceManager;
|
|
|
|
public class Taskpanel : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 二维地图页面
|
|
/// </summary>
|
|
public Button two_dimensional;
|
|
public Button playback_btn;//任务回放按钮
|
|
/// <summary>
|
|
/// 模型页面
|
|
/// </summary>
|
|
public RectTransform model;
|
|
/// <summary>
|
|
/// 二维地图页面
|
|
/// </summary>
|
|
|
|
public RectTransform measure_panl;//测量页面
|
|
public RectTransform punctuation_panl;//标记工具
|
|
public RectTransform specific_panl;//专用标会
|
|
public RectTransform model_panl;//模型列表
|
|
public RectTransform Viewpoint_flight_panl;//视点飞行
|
|
public Button measure_btn; //测量页面按钮
|
|
public Button punctuation_btn;//标记工按钮
|
|
public Button specific_btn;//模型列表按钮
|
|
public Button model_btn;//模型列表按钮
|
|
public Button viewpoint_btn;//视点飞行按钮
|
|
public Button cancel1;//叉掉按钮
|
|
public Button cancel2;//叉掉按钮
|
|
public Button cancel3;//叉掉按钮
|
|
public Button cancel4;//叉掉按钮
|
|
public Button cancel5;//叉掉按钮
|
|
public Button menu_button;//按钮显示收藏
|
|
public Button guanji_button;//按钮显示收藏
|
|
|
|
public Button fanhuiBtn;
|
|
public Button fanhui;
|
|
private bool isp = true;
|
|
void Start()
|
|
{
|
|
|
|
fanhui.onClick.AddListener(() =>
|
|
{
|
|
GameMain.tiao = false;
|
|
GameMain.visit = true;
|
|
OnLeaveRoom();
|
|
});
|
|
two_dimensional.onClick.AddListener(() =>
|
|
{
|
|
//two_dimensional.gameObject.SetActive(false);
|
|
//playback_btn.gameObject.SetActive(false);
|
|
model.gameObject.SetActive(true);
|
|
});
|
|
////返回按钮
|
|
//fanhuiBtn.onClick.AddListener(() =>
|
|
//{
|
|
// SceneManager.LoadScene("SampleScene");
|
|
//});
|
|
measure_btn.onClick.AddListener(() =>
|
|
{
|
|
measure_panl.gameObject.SetActive(true);
|
|
punctuation_panl.gameObject.SetActive(false);
|
|
specific_panl.gameObject.SetActive(false);
|
|
model_panl.gameObject.SetActive(false);
|
|
Viewpoint_flight_panl.gameObject.SetActive(false);
|
|
});
|
|
punctuation_btn.onClick.AddListener(() =>
|
|
{
|
|
measure_panl.gameObject.SetActive(false);
|
|
punctuation_panl.gameObject.SetActive(true);
|
|
specific_panl.gameObject.SetActive(false);
|
|
model_panl.gameObject.SetActive(false);
|
|
Viewpoint_flight_panl.gameObject.SetActive(false);
|
|
});
|
|
specific_btn.onClick.AddListener(() =>
|
|
{
|
|
measure_panl.gameObject.SetActive(false);
|
|
punctuation_panl.gameObject.SetActive(false);
|
|
specific_panl.gameObject.SetActive(true);
|
|
model_panl.gameObject.SetActive(false);
|
|
Viewpoint_flight_panl.gameObject.SetActive(false);
|
|
});
|
|
model_btn.onClick.AddListener(() =>
|
|
{
|
|
measure_panl.gameObject.SetActive(false);
|
|
punctuation_panl.gameObject.SetActive(false);
|
|
specific_panl.gameObject.SetActive(false);
|
|
model_panl.gameObject.SetActive(true);
|
|
Viewpoint_flight_panl.gameObject.SetActive(false);
|
|
});
|
|
viewpoint_btn.onClick.AddListener(() =>
|
|
{
|
|
measure_panl.gameObject.SetActive(false);
|
|
punctuation_panl.gameObject.SetActive(false);
|
|
specific_panl.gameObject.SetActive(false);
|
|
model_panl.gameObject.SetActive(false);
|
|
Viewpoint_flight_panl.gameObject.SetActive(true);
|
|
});
|
|
cancel1.onClick.AddListener(() =>
|
|
{
|
|
measure_panl.gameObject.SetActive(false);
|
|
});
|
|
cancel2.onClick.AddListener(() =>
|
|
{
|
|
punctuation_panl.gameObject.SetActive(false);
|
|
});
|
|
cancel3.onClick.AddListener(() =>
|
|
{
|
|
specific_panl.gameObject.SetActive(false);
|
|
});
|
|
cancel4.onClick.AddListener(() =>
|
|
{
|
|
model_panl.gameObject.SetActive(false);
|
|
});
|
|
cancel5.onClick.AddListener(() =>
|
|
{
|
|
Viewpoint_flight_panl.gameObject.SetActive(false);
|
|
});
|
|
guanji_button.onClick.AddListener(() =>
|
|
{
|
|
//string url = Url_Exit + GlobalFlag.currentUser.login_name;
|
|
//StartCoroutine(GetString(url, data =>
|
|
//{
|
|
// Debug.Log(data);
|
|
// Application.Quit();
|
|
//}));
|
|
Application.Quit();
|
|
});
|
|
menu_button.onClick.AddListener(() =>
|
|
{
|
|
if (isp == true)
|
|
{
|
|
//measure_btn.gameObject.SetActive(false);
|
|
//punctuation_btn.gameObject.SetActive(false);
|
|
specific_btn.gameObject.SetActive(false);
|
|
model_btn.gameObject.SetActive(false);
|
|
viewpoint_btn.gameObject.SetActive(false);
|
|
isp = false;
|
|
}
|
|
else
|
|
{
|
|
//measure_btn.gameObject.SetActive(true);
|
|
//punctuation_btn.gameObject.SetActive(true);
|
|
specific_btn.gameObject.SetActive(true);
|
|
model_btn.gameObject.SetActive(true);
|
|
viewpoint_btn.gameObject.SetActive(true);
|
|
isp = true;
|
|
}
|
|
});
|
|
}
|
|
|
|
public void OnLeaveRoom()
|
|
{
|
|
string _msg = "leaveroom ";
|
|
MyNetMQClient.instance._netMqListener.UnSubtopic(GlobalFlag.roomID);
|
|
_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
|
|
}
|
|
|
|
}
|