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

51 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using Unity.VisualScripting;
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;
public Image head;
public Text Name;
public Text Id;
void Start()
{
Avatarbtn.onClick.AddListener(Display_pop_up_window);
AvatarPanel.gameObject.SetActive(false);
UpdateShow();
}
private void Display_pop_up_window()
{
AvatarPanel.gameObject.GetComponent<ReviseName>().UpdateShow();
}
public void CloseClick()
{
AvatarPanel.gameObject.SetActive(false);
}
public async void UpdateShow()
{
PlayerInfoData _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
this.Name.text =_PlayerInfoData.nickname.ToString();
this.Id.text = _PlayerInfoData.uid.ToString();
this.head.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(_PlayerInfoData.avatar_url);
}
}