2024-11-12 23:18:51 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2024-12-23 14:02:30 +08:00
|
|
|
|
using Unity.VisualScripting;
|
2024-11-12 23:18:51 +08:00
|
|
|
|
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
|
|
|
|
|
2024-12-24 21:12:43 +08:00
|
|
|
|
|
2024-12-19 00:57:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool isUpdating=false;
|
2024-11-12 23:18:51 +08:00
|
|
|
|
// Start is called before the first frame update
|
2024-12-23 14:02:30 +08:00
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-12 23:18:51 +08:00
|
|
|
|
void Start()
|
|
|
|
|
{
|
2024-12-23 14:02:30 +08:00
|
|
|
|
UpDateText();
|
|
|
|
|
|
2024-11-12 23:18:51 +08:00
|
|
|
|
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(() => {
|
2024-12-23 14:02:30 +08:00
|
|
|
|
mygameObject.GetComponent<Asset_Details>().ShowPanel(4);
|
2024-11-12 23:18:51 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (but4 != null)
|
|
|
|
|
{
|
2024-12-18 15:32:45 +08:00
|
|
|
|
but4.onClick.AddListener(() => {
|
2024-12-23 14:02:30 +08:00
|
|
|
|
mygameObject.GetComponent<Asset_Details>().ShowPanel(3);
|
2024-11-12 23:18:51 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2024-12-23 14:02:30 +08:00
|
|
|
|
|
2024-12-19 00:57:23 +08:00
|
|
|
|
InvokeRepeating("UpDateText", 1f,1f);
|
|
|
|
|
|
2024-11-12 23:18:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-11-14 09:57:30 +08:00
|
|
|
|
|
2024-12-19 00:57:23 +08:00
|
|
|
|
private void UpDateText()
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӷ<EFBFBD><D3B7>أ<EFBFBD><D8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if (isUpdating)
|
|
|
|
|
return;
|
|
|
|
|
UpdateTaxt();
|
|
|
|
|
}
|
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-19 00:57:23 +08:00
|
|
|
|
isUpdating = true;
|
2024-12-30 12:49:29 +08:00
|
|
|
|
CapitalbalanceIndefo CapitalbalanceData = await Scene_main_jiekou.instance.CapitalbalanceInfos();
|
2024-12-30 16:47:34 +08:00
|
|
|
|
Stone.text = CapitalbalanceData.data.gem.ToString("F2");
|
|
|
|
|
Coin.text = CapitalbalanceData.data.gold.ToString("F2");
|
|
|
|
|
Ore.text = CapitalbalanceData.data.water.ToString("F2");
|
|
|
|
|
Forging.text = CapitalbalanceData.data.forge.ToString("F2");
|
2024-12-30 12:49:29 +08:00
|
|
|
|
CapitalbalanceData = null;
|
2024-12-19 00:57:23 +08:00
|
|
|
|
// <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD><EFBFBD>Ϊδִ<CEB4><D6B4>
|
|
|
|
|
isUpdating = false;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-19 15:25:25 +08:00
|
|
|
|
private void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
InvokeRepeating("UpDateText", 1f, 1f);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-19 00:57:23 +08:00
|
|
|
|
private void OnDisable()
|
|
|
|
|
{
|
|
|
|
|
CancelInvoke("UpDateText");
|
2024-11-14 09:57:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-11-12 23:18:51 +08:00
|
|
|
|
}
|