Cute_demon_attacks/meng_yao/Assets/script/scene_Main/AssetsPanel.cs

81 lines
2.1 KiB
C#
Raw Normal View History

2024-11-12 23:18:51 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AssetsPanel : MonoBehaviour
{
[Header("<22><>ť<EFBFBD><C5A5><EFBFBD>ǵö<C7B5>Ӧ<EFBFBD><D3A6>ϵ")]
public Button but1;
public Button but2;
public Button but3;
public Button but4;
2024-11-14 17:18:51 +08:00
[Header("<22><><EFBFBD>°<EFBFBD>ť<EFBFBD><C5A5>ʾ<EFBFBD><CABE>panel<65><6C>Ŀǰ<C4BF><C7B0>ͬһ<CDAC><D2BB>")]
2024-11-12 23:18:51 +08:00
public GameObject mygameObject;
2024-11-14 09:57:30 +08:00
public bool is_one = false;
public Text Stone;
public Text Coin;
public Text Ore;
public Text Forging;
2024-12-17 17:18:09 +08:00
public Text UserName;
public Text UserID;
public Image UserHead;
2024-12-17 22:23:25 +08:00
public Text PersonaText;
public Text PersonID;
2024-11-12 23:18:51 +08:00
// Start is called before the first frame update
void Start()
{
if (but1 != null)
{
2024-11-14 17:18:51 +08:00
but1.onClick.AddListener(() => {
2024-11-12 23:18:51 +08:00
mygameObject.SetActive(true);
});
}
if (but2 != null)
{
2024-11-14 17:18:51 +08:00
but2.onClick.AddListener(() => {
2024-11-12 23:18:51 +08:00
mygameObject.SetActive(true);
});
}
if (but3 != null)
{
2024-11-14 17:18:51 +08:00
but3.onClick.AddListener(() => {
2024-11-12 23:18:51 +08:00
mygameObject.SetActive(true);
});
}
if (but4 != null)
{
2024-11-14 17:18:51 +08:00
but4.onClick.AddListener(() => {
2024-11-12 23:18:51 +08:00
mygameObject.SetActive(true);
});
}
2024-12-17 15:31:37 +08:00
UpdateTaxt();
2024-11-12 23:18:51 +08:00
}
2024-11-14 09:57:30 +08:00
2024-12-17 15:31:37 +08:00
async void UpdateTaxt()
2024-11-14 09:57:30 +08:00
{
2024-12-17 15:31:37 +08:00
PlayerInfoData info=await Scene_main_jiekou.instance.PlayerInfos();
2024-12-17 17:18:09 +08:00
Stone.text = Scene_main_jiekou.instance.infoData.gem.ToString();
Coin.text = Scene_main_jiekou.instance.infoData.gold.ToString();
Ore.text = Scene_main_jiekou.instance.infoData.water.ToString();
Forging.text = Scene_main_jiekou.instance.infoData.forge.ToString();
UserName.text = Scene_main_jiekou.instance.infoData.nickname.ToString();
2024-12-17 22:23:25 +08:00
PersonaText.text = Scene_main_jiekou.instance.infoData.nickname.ToString();
2024-12-17 17:18:09 +08:00
UserID.text = Scene_main_jiekou.instance.infoData.uid.ToString();
2024-12-17 22:23:25 +08:00
PersonID.text = Scene_main_jiekou.instance.infoData.uid.ToString();
2024-12-17 17:18:09 +08:00
2024-11-14 09:57:30 +08:00
}
2024-11-12 23:18:51 +08:00
}