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

38 lines
1.1 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using XFrame.Core.UI;
using DG.Tweening;
public class AnalysisPanel : XUIPanel
{
public AnalysisPanel() : base(UIType.Normal, UIMode.HideOther, UICollider.Normal)
{
uiPath = "UIPrefab/AnalysisPanel";
}
public override void Awake(GameObject go)
{
this.gameObject.transform.Find("btn-confirm").GetComponent<Button>().onClick.AddListener(() =>
{
Hide();
});
this.gameObject.transform.Find("btn-test").GetComponent<Button>().onClick.AddListener(() =>
{
ShowPanel<PopPanel>();
});
}
public override void Active()
{
base.Active();
OnEnter();
}
public void OnEnter()
{
this.gameObject.transform.localPosition = new Vector3(-2000, this.gameObject.transform.localPosition.y, this.gameObject.transform.localPosition.z);
this.gameObject.transform.DOLocalMoveX(0, 0.5f).SetEase(Ease.OutExpo);
}
public override void Hide()
{
canInteractive = false;
this.gameObject.transform.DOLocalMoveX(-2000, 0.5f).SetEase(Ease.OutExpo).OnComplete(base.Hide);
}
}