矿场弹窗动画

This commit is contained in:
杨号敬 2024-12-09 14:33:01 +08:00
parent d69755fa34
commit e3d0be8eeb
2 changed files with 15 additions and 3 deletions

View File

@ -4,7 +4,7 @@ using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using UnityEngine.UI; using UnityEngine.UI;
using DG.Tweening;
public delegate void SetActiveDelegate(bool isActive); public delegate void SetActiveDelegate(bool isActive);
public class KuangChang : MonoBehaviour public class KuangChang : MonoBehaviour
@ -62,9 +62,19 @@ public class KuangChang : MonoBehaviour
Userdata.text = queryUserVoluteCoinResponse.data.ToString(); Userdata.text = queryUserVoluteCoinResponse.data.ToString();
// 返回主页按钮的点击事件 // 返回主页按钮的点击事件
ReturnButton.onClick.AddListener(() => { SceneManager.LoadScene(1); }); ReturnButton.onClick.AddListener(() =>
{
ReturnButton.transform.DOScale(1.5f, 0.25f);
ReturnButton.transform.DOScale(1f, 0.25f);
Invoke("ToMain", 0.5f);
});
} }
void ToMain()
{
SceneManager.LoadScene(1);
}
public async void UpdateUserdata() public async void UpdateUserdata()
{ {
QueryUserVoluteCoinResponse queryUserVoluteCoinResponse = await queryUserVoluteCoin.QueryUserVoluteCoin(); QueryUserVoluteCoinResponse queryUserVoluteCoinResponse = await queryUserVoluteCoin.QueryUserVoluteCoin();
@ -76,6 +86,8 @@ public class KuangChang : MonoBehaviour
if (kuanghcangPop != null) if (kuanghcangPop != null)
{ {
kuanghcangPop.SetActive(isActive); kuanghcangPop.SetActive(isActive);
kuanghcangPop.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
kuanghcangPop.transform.DOScale(1f, 0.5f);
} }
QueryUserVoluteCoinResponse queryUserVoluteCoinResponse = await queryUserVoluteCoin.QueryUserVoluteCoin(); QueryUserVoluteCoinResponse queryUserVoluteCoinResponse = await queryUserVoluteCoin.QueryUserVoluteCoin();
Userdata.text = queryUserVoluteCoinResponse.data.ToString(); Userdata.text = queryUserVoluteCoinResponse.data.ToString();