mergemilitary/Assets/Scripts/UIs/PanelTips.cs

35 lines
768 B
C#
Raw Normal View History

2022-05-23 13:39:59 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class PanelTips : BasePanel
{
2022-07-04 11:17:39 +00:00
[SerializeField] CanvasGroup mCvsBg;
[SerializeField] RectTransform mRctBg;
2022-05-23 13:39:59 +00:00
2022-07-04 11:17:39 +00:00
[SerializeField] Text mTxtTip;
2022-05-23 13:39:59 +00:00
2022-07-04 11:17:39 +00:00
public override void OnOpen()
2022-05-23 13:39:59 +00:00
{
2022-07-04 11:17:39 +00:00
base.OnOpen();
2022-05-23 13:39:59 +00:00
2022-07-04 11:17:39 +00:00
mCvsBg.alpha = 0;
mRctBg.anchoredPosition = new Vector2(0, -100);
mCvsBg.DOKill();
mRctBg.DOKill();
mCvsBg.DOFade(1, 0.3f);
mRctBg.DOAnchorPosY(100, 0.3f);
mCvsBg.DOFade(0, 0.3f).SetDelay(1.3f);
mRctBg.DOAnchorPosY(-100, 0.3f).SetDelay(1.3f).onComplete = Close;
2022-05-23 13:39:59 +00:00
}
2022-07-04 11:17:39 +00:00
public void ShowTips(string pTipStr)
2022-05-23 13:39:59 +00:00
{
2022-07-04 11:17:39 +00:00
mTxtTip.text = pTipStr;
2022-05-23 13:39:59 +00:00
}
}