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

78 lines
1.8 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-12-18 20:52:56 +08:00
2024-11-12 23:18:51 +08:00
// Start is called before the first frame update
void Start()
{
if (but1 != null)
{
2024-12-18 15:32:45 +08:00
but1.onClick.AddListener(() =>
{
mygameObject.GetComponent<Asset_Details>().ShowPanel(2);
2024-11-12 23:18:51 +08:00
});
}
if (but2 != null)
{
2024-12-18 15:32:45 +08:00
but2.onClick.AddListener(() => {
mygameObject.GetComponent<Asset_Details>().ShowPanel(1);
2024-11-12 23:18:51 +08:00
});
}
if (but3 != null)
{
2024-12-18 15:32:45 +08:00
but3.onClick.AddListener(() => {
mygameObject.GetComponent<Asset_Details>().ShowPanel(3);
2024-11-12 23:18:51 +08:00
});
}
if (but4 != null)
{
2024-12-18 15:32:45 +08:00
but4.onClick.AddListener(() => {
mygameObject.GetComponent<Asset_Details>().ShowPanel(4);
2024-11-12 23:18:51 +08:00
});
}
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-18 20:52:56 +08:00
PlayerInfoData _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
2024-12-18 20:32:37 +08:00
Stone.text = _PlayerInfoData.gem.ToString();
Coin.text = _PlayerInfoData.gold.ToString();
Ore.text = _PlayerInfoData.water.ToString();
Forging.text = _PlayerInfoData.forge.ToString();
2024-11-14 09:57:30 +08:00
}
2024-11-12 23:18:51 +08:00
}