HKMBFZ/Assets/Scripts/Szz_Scripts/UI/122/射击实施/SheJiShiShi122Page.cs

114 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}