Files
Studio/Assets/TMPFolder/UI_BaseDataButton.cs

43 lines
915 B
C#
Raw Normal View History

2025-05-22 16:12:56 +09:00
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using XED.UI;
2025-05-22 18:29:09 +09:00
using Studio.Setting.Connect;
2025-05-23 12:33:04 +09:00
using XRLib.UI;
2025-05-22 18:29:09 +09:00
2025-05-22 16:12:56 +09:00
namespace XED
{
2025-05-23 12:33:04 +09:00
public class UI_BaseDataButton : UIBase
2025-05-22 16:12:56 +09:00
{
public Panel_Repository panel_Repository;
Button button;
TextMeshProUGUI buttonName;
2025-05-22 18:29:09 +09:00
string baseDataKey;
2025-05-23 13:59:45 +09:00
StudioEntityWithState<object> dataValue;
2025-05-22 18:29:09 +09:00
2025-05-22 16:12:56 +09:00
private void Awake()
{
button = GetComponent<Button>();
buttonName = GetComponentInChildren<TextMeshProUGUI>();
button.onClick.AddListener(OnClickButton);
}
void OnClickButton()
{
2025-05-23 13:59:45 +09:00
panel_Repository.ShowInformation_APIData(dataValue);
2025-05-22 16:12:56 +09:00
}
2025-05-22 18:29:09 +09:00
public void SetButtonData(string name, StudioEntityWithState<object> data)
2025-05-22 16:12:56 +09:00
{
2025-05-22 18:29:09 +09:00
baseDataKey = name;
2025-05-23 13:59:45 +09:00
dataValue = data;
2025-05-22 16:12:56 +09:00
2025-05-22 18:29:09 +09:00
buttonName.text = name;
2025-05-22 16:12:56 +09:00
}
}
}