54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using XFrame.Core.UI;
|
|
using UnityEngine.UI;
|
|
using DG.Tweening;
|
|
namespace YHElectric
|
|
{
|
|
public class ModelPanel : XUIPanel
|
|
{
|
|
Transform bg;
|
|
Transform btn;
|
|
Transform model;
|
|
public static bool Actived = false;
|
|
public ModelPanel() : base(UIType.PopUp, UIMode.None, UICollider.None)
|
|
{
|
|
uiPath = "UI/UIPanelPrefab/ModelPanel";
|
|
}
|
|
public override void Awake(GameObject go)
|
|
{
|
|
bg = transform.Find("BG");
|
|
model = bg.Find("model");
|
|
//btn = transform.Find("BG/model/Button");
|
|
//btn.GetComponent<Button>().onClick.AddListener(BtnOnClick);
|
|
}
|
|
public override void Active()
|
|
{
|
|
base.Active();
|
|
OnEnter();
|
|
}
|
|
void OnEnter()
|
|
{
|
|
Actived = true;
|
|
|
|
|
|
}
|
|
public override void Hide()
|
|
{
|
|
Actived = false;
|
|
|
|
ClosePanel<MaskPanel>();
|
|
model.DOScale(Vector3.zero, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() => base.Hide());
|
|
}
|
|
public void BtnOnClick()
|
|
{
|
|
btn.gameObject.SetActive(false);
|
|
XUIPanel.ClosePanel<ModelPanel>();
|
|
XUIPanel.ClosePanel<DevInfoPanel>();
|
|
XUIPanel.ShowPanel<MaskPanel>();
|
|
XUIPanel.ShowPanel<WireDiagramPanel>();
|
|
}
|
|
}
|
|
}
|