You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ipad : MonoBehaviour
{
GameObject curMenu;
GameObject curNavigation;
public static GameObject curDetail;
public GameObject Menu_SY;
public GameObject Menu_CJ;
public GameObject Navigation_SY;
public GameObject Detail_SY;
private void Awake()
{
curMenu = Menu_SY;
curNavigation = Navigation_SY;
curDetail = Detail_SY;
}
public void setCurMenu(GameObject menu) {
if (!curMenu) {
curMenu = Menu_SY;
}
curMenu.transform.GetChild(0).gameObject.SetActive(false);
curMenu = menu;
if (curMenu==Menu_CJ) {
TaskCenter.GetInstance().FinishTask(5);
}
curMenu.transform.GetChild(0).gameObject.SetActive(true);
ShowNavigation();
}
private void ShowNavigation()
{
if (!curNavigation) {
curNavigation = Navigation_SY;
}
curNavigation.SetActive(false);
curMenu.GetComponent<SubPage>().navigation.SetActive(true);
curNavigation = curMenu.GetComponent<SubPage>().navigation;
}
public void SetCurDetail(GameObject target) {
curDetail.SetActive(false);
target.GetComponent<SubPage>().detail.SetActive(true);
curDetail = target.GetComponent<SubPage>().detail;
}
public void setDefaultDetail(GameObject target) {
if (curDetail) {
return;
}
curDetail = target;
}
}