NewN_UAVPlane/Assets/Temp/Scripts/Main_interface_Panel.cs

59 lines
1.8 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using XFrame.Core.UI;
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(() =>
{
UIBootstrap.Instance.OnLogout();
SceneManager.LoadScene("SampleScene");
});
ShowPanel<View_Panel2>();
replay.onClick.AddListener(() => { ReplayPanel(); });
train.onClick.AddListener(() => { TrainPanel(); });
appQuet.onClick.AddListener(() => { Application.Quit();
//Debug.Log("退出");
});
}
/// <summary>
/// 训练界面控制
/// </summary>
public void TrainPanel()
{
//ClosePanel<ReplayPanel>();
ClosePanel<DoublePlay>();
//ClosePanel<IntroducePanel>();
ShowPanel<View_Panel2>();
}
/// <summary>
/// 复盘回放界面控制
/// </summary>
public void ReplayPanel()
{
//ShowPanel<ReplayPanel>();
ShowPanel<DoublePlay>();
ClosePanel<View_Panel2>();
}
}