75 lines
1.8 KiB
C#
75 lines
1.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ZhuJieMianPage : UIPageBtnEventBase
|
|
{
|
|
|
|
public List<GameObject> pages=new List<GameObject>();
|
|
|
|
public GameObject JiShuZhenDiUI; //技术阵地UI
|
|
public GameObject 行军导航UI;
|
|
|
|
public override void OnF1Click()
|
|
{
|
|
base.OnF1Click();
|
|
//pages[0].SetActive(true);
|
|
InstancePage(0);
|
|
JiShuZhenDiUI.SetActive(true);
|
|
//gameObject.SetActive(false);
|
|
gameObject.transform.parent.gameObject.SetActive(false);
|
|
}
|
|
|
|
public override void OnF2Click()
|
|
{
|
|
base.OnF2Click();
|
|
//pages[1].SetActive(true);
|
|
InstancePage(1);
|
|
行军导航UI.SetActive(true);
|
|
|
|
//gameObject.SetActive(false);
|
|
gameObject.transform.parent.gameObject.SetActive(false);
|
|
}
|
|
|
|
public override void OnF3Click()
|
|
{
|
|
base.OnF3Click();
|
|
//pages[2].SetActive(true);
|
|
InstancePage(2);
|
|
//gameObject.SetActive(false);
|
|
gameObject.transform.parent.gameObject.SetActive(false);
|
|
|
|
}
|
|
|
|
public override void OnF4Click()
|
|
{
|
|
base.OnF4Click();
|
|
//pages[3].SetActive(true);
|
|
InstancePage(3);
|
|
//gameObject.SetActive(false);
|
|
gameObject.transform.parent.gameObject.SetActive(false);
|
|
|
|
}
|
|
|
|
public override void OnF5Click()
|
|
{
|
|
base.OnF5Click();
|
|
//pages[4].SetActive(true);
|
|
InstancePage(4);
|
|
//ameObject.SetActive(false);
|
|
gameObject.transform.parent.gameObject.SetActive(false);
|
|
|
|
}
|
|
|
|
GameObject currectPage;
|
|
public Transform pageParent;
|
|
|
|
public void InstancePage(int index)
|
|
{
|
|
if(currectPage!=null)
|
|
Destroy(currectPage);
|
|
currectPage=Instantiate(pages[index], pageParent);
|
|
currectPage.SetActive(true);
|
|
}
|
|
}
|