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 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>(); 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(() => { SceneManager.LoadScene("SampleScene"); }); replay.onClick.AddListener(() => { ReplayPanel(); }); train.onClick.AddListener(() => { TrainPanel(); }); } /// <summary> /// 训练界面控制 /// </summary> public void TrainPanel() { ClosePanel<ReplayPanel>(); ClosePanel<IntroducePanel>(); ShowPanel<View_Panel2>(); } /// <summary> /// 复盘回放界面控制 /// </summary> public void ReplayPanel() { ShowPanel<ReplayPanel>(); ClosePanel<View_Panel2>(); } }