114 lines
2.6 KiB
C#
114 lines
2.6 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using TMPro;
|
||
using UnityEngine;
|
||
|
||
using SK.Framework;
|
||
|
||
public class SheJiShiShi122Page : UIPageBtnEventBase
|
||
{
|
||
public GameObject 诸元方式;
|
||
public GameObject 操瞄调炮;
|
||
public GameObject 弹药准备;
|
||
|
||
public List<GameObject> pages = new List<GameObject>();
|
||
|
||
Manager122Base manager122;
|
||
|
||
public CustomTMPDropdown custom1;
|
||
public CustomTMPDropdown custom2;
|
||
|
||
|
||
private void Awake()
|
||
{
|
||
manager122 = Manager122Base.instance;
|
||
}
|
||
|
||
private void OnEnable()
|
||
{
|
||
//StartCoroutine(InsertFouces());
|
||
}
|
||
|
||
IEnumerator InsertFouces()
|
||
{
|
||
yield return new WaitForSeconds(0.1f);
|
||
诸元方式.GetComponent<FocusPage>().focusElements.Insert(0, custom2);
|
||
诸元方式.GetComponent<FocusPage>().focusElements.Insert(1, custom1);
|
||
}
|
||
|
||
|
||
public override void OnF1Click()
|
||
{
|
||
base.OnF1Click();
|
||
//在此界面,F1为装弹检测,点击后出现绿色标点
|
||
|
||
//StartCoroutine(showTips("正在进行装弹检测...", 3f, "装弹检测完毕!"));
|
||
|
||
ShowPage(0);
|
||
}
|
||
|
||
public override void OnF2Click()
|
||
{
|
||
base.OnF2Click();
|
||
ShowPage(1);
|
||
}
|
||
public override void OnF3Click()
|
||
{
|
||
base.OnF3Click();
|
||
manager122.Show122DwonMsg("插连接器成功");
|
||
}
|
||
|
||
public override void OnF4Click()
|
||
{
|
||
base.OnF4Click();
|
||
ShowPage(2);
|
||
}
|
||
public override void OnF5Click()
|
||
{
|
||
base.OnF5Click();
|
||
manager122.Show122DwonMsg("断连接器成功");
|
||
}
|
||
|
||
|
||
public override void OnF7Click()
|
||
{
|
||
base.OnF7Click();
|
||
manager122.defalutPage.SetActive(true);
|
||
Destroy(gameObject);
|
||
}
|
||
GameObject currectPage;
|
||
|
||
public void ShowPage(int index)
|
||
{
|
||
for (int i = 0; i < pages.Count; i++)
|
||
{
|
||
pages[i].SetActive(false);
|
||
}
|
||
currectPage = pages[index];
|
||
currectPage.SetActive(true);
|
||
//currectPage.GetComponent<FocusPage>().focusElements.Insert(0, custom1);
|
||
//currectPage.GetComponent<FocusPage>().focusElements.Insert(1, custom2);
|
||
//StartCoroutine(InsertFouces1());
|
||
}
|
||
|
||
IEnumerator InsertFouces1()
|
||
{
|
||
yield return new WaitForSeconds(0.1f);
|
||
currectPage.GetComponent<FocusPage>().focusElements.Insert(0, custom2);
|
||
currectPage.GetComponent<FocusPage>().focusElements.Insert(1, custom1);
|
||
}
|
||
|
||
public void ShowZiDongPage()
|
||
{
|
||
for (int i = 0; i < pages.Count; i++)
|
||
{
|
||
pages[i].SetActive(false);
|
||
}
|
||
currectPage = pages[0];
|
||
currectPage.SetActive(true);
|
||
|
||
}
|
||
|
||
|
||
}
|