Files
Continentis/Assets/Scripts/MainGame/UI/CombatMainPage/RoundHint.cs
SoulliesOfficial 40660b41e0 角色死亡
2025-12-12 01:37:30 -05:00

39 lines
1.3 KiB
C#

using DG.Tweening;
using I2.Loc;
using SLSFramework.General;
using TMPro;
using UnityEngine;
namespace Continentis.MainGame.UI
{
public class RoundHint : MonoBehaviour
{
public TMP_Text hintText;
public LocalizationParamsManager locParams;
private Sequence textAnimationSeq;
public void PlayRoundHint(int round)
{
gameObject.SetActive(true);
locParams.SetParameterValue("Round", round.ToString());
hintText.text = "GameUI/Round_Hint".Localize(hintText.gameObject);
Material textMat = hintText.fontMaterial;
float fadeInDuration = 1f;
float holdDuration = 1f;
float fadeOutDuration = 0.5f;
textAnimationSeq?.Kill();
textAnimationSeq = DOTween.Sequence();
textAnimationSeq.Append(textMat.DOFloat(1f, "_FullGlowDissolveFade", fadeInDuration).From(0f));
textAnimationSeq.AppendInterval(holdDuration);
textAnimationSeq.Append(textMat.DOFloat(0f, "_FullDistortionFade", fadeOutDuration).From(1f));
textAnimationSeq.OnComplete(() => { gameObject.SetActive(false); });
textAnimationSeq.Play();
}
}
}