34 lines
1011 B
C#
34 lines
1011 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using XFrame.Core.UI;
|
|
using DG.Tweening;
|
|
public class WarningPanel : XUIPanel
|
|
{
|
|
public WarningPanel() : base(UIType.Normal, UIMode.HideOther, UICollider.Normal)
|
|
{
|
|
uiPath = "UIPrefab/WarningPanel";
|
|
}
|
|
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.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);
|
|
}
|
|
}
|