34 lines
776 B
C#
34 lines
776 B
C#
using DG.Tweening;
|
|
using Sirenix.OdinInspector;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Uis
|
|
{
|
|
public class PayMoneyUi : MonoBehaviour
|
|
{
|
|
[SerializeField, Required]
|
|
private DOTweenAnimation _moveAnimation;
|
|
|
|
[SerializeField, Required]
|
|
private GameObject _panel;
|
|
|
|
[SerializeField, Required]
|
|
private TMP_Text _goldText;
|
|
|
|
private void OnDestroy()
|
|
{
|
|
_moveAnimation.DOKill();
|
|
}
|
|
|
|
public void PayMoney(int gold)
|
|
{
|
|
_goldText.text = gold.ToString("N0");
|
|
ShowUi();
|
|
_moveAnimation.DORestart();
|
|
}
|
|
|
|
public void ShowUi() => _panel.SetActive(true);
|
|
public void HideUi() => _panel.SetActive(false);
|
|
}
|
|
} |