NewN_UAVPlane/Assets/Temp/Scripts/Main_interface_Panel.cs

82 lines
2.4 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using XFrame.Core.UI;
using static InterfaceManager;
public class Main_interface_Panel : XUIPanel
{
public Button fanhui_btn;//返回初始界面
public Button train;
public Button replay;
public Button appQuet;
public Main_interface_Panel() : base(UIType.Fixed, UIMode.None, UICollider.None)
{
uiPath = "UIPanel/Main_interface_Panel";
}
public override void Awake(GameObject go)
{
replay = this.transform.Find("UPBG/double_quotation_btn").GetComponent<Button>();
train = this.transform.Find("UPBG/training_task_btn").GetComponent<Button>();
appQuet = this.transform.Find("UPBG/Power_Off_btn").GetComponent<Button>();
fanhui_btn = this.transform.Find("UPBG/Back_bton").GetComponent<Button>();
fanhui_btn.onClick.AddListener(() =>
{
});
ShowPanel<View_Panel2>();
this.transform.Find("UPBG/Back_bton").GetComponent<Button>().onClick.AddListener(() =>
{
GameObject obj = GameObject.Find("Canvas");
if (obj != null)
{
Login_panl login_panl = obj.GetComponent<Login_panl>();
if (login_panl != null)
{
login_panl.AddGetString(true);
}
}
});
replay.onClick.AddListener(() => { ReplayPanel(); });
train.onClick.AddListener(() => { TrainPanel(); });
appQuet.onClick.AddListener(() => {
GameObject obj = GameObject.Find("Canvas");
if (obj != null)
{
Login_panl login_panl = obj.GetComponent<Login_panl>();
if (login_panl != null)
{
login_panl.AddGetString(false);
}
}
//Debug.Log("退出");
});
}
/// <summary>
/// 训练界面控制
/// </summary>
public void TrainPanel()
{
ClosePanel<ReplayPanel>();
ClosePanel<IntroducePanel>();
ShowPanel<View_Panel2>();
}
/// <summary>
/// 复盘回放界面控制
/// </summary>
public void ReplayPanel()
{
ShowPanel<ReplayPanel>();
ClosePanel<View_Panel2>();
}
}