wuxianshengcong/Assets/Scripts/NavPanel.cs
2024-12-30 10:39:09 +08:00

67 lines
1.8 KiB
C#

using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
public class NavPanel : Anim
{
public static NavPanel instance;
[Header("Panel")]
public GameObject MainGameObject;
public GameObject TeamGameObject;
public GameObject JourneygGameObject;
public GameObject BPGameObject;
public GameObject GuildGameObject;
public GameObject WorldHomegGameObject;
[Header("°´Å¥")]
public GameObject ReGameObject;
public Button SHopButton;
public Button TeanButton;
public Button GonhuiButton;
public Button WorldHomeButton;
GameObject item=null;
// Start is called before the first frame update
void Start()
{
instance= this;
ReGameObject.SetActive(false);
TeamGameObject.SetActive(false);
TeanButton.onClick.AddListener(() =>
{
CloseMain();
TeamGameObject.GetComponent<Team>().Backchild();
TeamGameObject.SetActive(true);
item = TeamGameObject;
//TeamGameObject.transform.DOMoveY(1400, 1f);
});
ReGameObject.GetComponent<Button>().onClick.AddListener(() =>
{
TeamGameObject.GetComponent<Team>().movechild();
item.SetActive(false);
OpenMain();
});
}
public void CloseMain()
{
MainGameObject.GetComponent<Main>().movechild();
MainGameObject.SetActive(false);
ReGameObject.SetActive(true);
}
public void OpenMain()
{
MainGameObject.GetComponent<Main>().Backchild();
MainGameObject.SetActive(true);
ReGameObject.SetActive(false);
item = null;
}
// Update is called once per frame
void Update()
{
}
}