_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Conversion/DonatePanelItem.cs

37 lines
1.0 KiB
C#
Raw Normal View History

2024-11-26 15:50:49 +08:00
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class DonatePanelItem : BaseUIPanel
{
public TMP_InputField Recipient;
public TMP_InputField GiftQuantity;
public Text NumberOfFreeSnailShells;
public Text Fees;
public Text Total;
2024-11-26 16:40:57 +08:00
public Button Button;
2024-11-26 15:50:49 +08:00
void Start()
{
GiftQuantity.onValueChanged.AddListener(GiftQuantityData);
2024-11-26 16:40:57 +08:00
Button.onClick.AddListener(buttonOnClick);
testLogo();
2024-11-26 15:50:49 +08:00
}
2024-11-26 16:40:57 +08:00
void buttonOnClick()
2024-11-26 15:50:49 +08:00
{
2024-11-26 16:40:57 +08:00
2024-11-26 15:50:49 +08:00
}
async void GiftQuantityData(string userInput)
{
NumberOfFreeSnailShells.text = userInput;
await ButtonClickAnimationAsync(NumberOfFreeSnailShells.gameObject, 1.05f);
Fees.text = (int.Parse(userInput) * 0.08).ToString();
await ButtonClickAnimationAsync(Fees.gameObject, 1.05f);
Total.text = (int.Parse(userInput) + (int.Parse(userInput) * 0.08)).ToString();
await ButtonClickAnimationAsync(Total.gameObject, 1.05f);
}
}