NewN_UAVPlane/Assets/Toolset/XFrame/Example/Scripts/UIPanel/PopPanel.cs

35 lines
937 B
C#

using UnityEngine;
using UnityEngine.UI;
using XFrame.Core.UI;
using DG.Tweening;
public class PopPanel : XUIPanel
{
public PopPanel() : base(UIType.PopUp, UIMode.None, UICollider.Normal)
{
uiPath = "UIPrefab/PopPanel";
}
public override void Awake(GameObject go)
{
this.gameObject.transform.Find("btn-confirm").GetComponent<Button>().onClick.AddListener(() =>
{
Hide();
});
}
public override void Active()
{
base.Active();
OnEnter();
}
public void OnEnter()
{
this.gameObject.transform.localScale = Vector3.zero;
this.gameObject.transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutExpo);
}
public override void Hide()
{
ClosePanel<MaskPanel>();
canInteractive = false;
this.gameObject.transform.DOScale(Vector3.zero, 0.5f).SetEase(Ease.OutExpo).OnComplete(base.Hide);
}
}