Cute_demon_attacks/meng_yao/Assets/script/TanChuang/HeadTanchuang.cs

51 lines
1.2 KiB
C#
Raw Normal View History

2024-11-13 17:58:34 +08:00
using System.Collections;
using System.Collections.Generic;
2024-12-18 20:32:37 +08:00
using System.Threading.Tasks;
2024-11-13 17:58:34 +08:00
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
2024-12-18 20:32:37 +08:00
using Unity.VisualScripting;
2024-11-13 17:58:34 +08:00
public class HeadTanchuang : MonoBehaviour
{
public GameObject AvatarPanel;
public Button Avatarbtn;
public RectTransform AvatarRect;
Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f);
public Transform canvas;
2025-01-04 15:34:17 +08:00
public Image head;
2024-12-18 20:32:37 +08:00
2024-11-13 17:58:34 +08:00
2024-12-18 20:32:37 +08:00
public Text Name;
public Text Id;
2024-12-18 21:04:28 +08:00
2024-11-13 17:58:34 +08:00
void Start()
2024-12-18 20:32:37 +08:00
{
2024-11-13 17:58:34 +08:00
Avatarbtn.onClick.AddListener(Display_pop_up_window);
AvatarPanel.gameObject.SetActive(false);
2024-12-18 20:32:37 +08:00
UpdateShow();
2024-11-13 17:58:34 +08:00
}
private void Display_pop_up_window()
{
2024-12-18 21:04:28 +08:00
AvatarPanel.gameObject.GetComponent<ReviseName>().UpdateShow();
2024-11-13 17:58:34 +08:00
}
public void CloseClick()
{
AvatarPanel.gameObject.SetActive(false);
}
2024-12-18 21:04:28 +08:00
public async void UpdateShow()
2024-12-18 20:32:37 +08:00
{
2024-12-18 20:52:56 +08:00
PlayerInfoData _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
this.Name.text =_PlayerInfoData.nickname.ToString();
this.Id.text = _PlayerInfoData.uid.ToString();
2025-01-04 16:21:06 +08:00
this.head.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(_PlayerInfoData.avatar_url);
2024-12-18 20:32:37 +08:00
}
2024-11-13 17:58:34 +08:00
}