Files
Studio/Assets/TMPFolder/UI_BaseDataButton.cs

43 lines
959 B
C#
Raw Normal View History

2025-05-25 13:24:48 +09:00
using TMPro;
2025-05-22 16:12:56 +09:00
using UnityEngine;
using UnityEngine.UI;
2025-05-23 19:00:09 +09:00
using Studio.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
2025-05-23 19:00:09 +09:00
namespace Studio
2025-05-22 16:12:56 +09:00
{
2025-05-23 12:33:04 +09:00
public class UI_BaseDataButton : UIBase
2025-05-22 16:12:56 +09:00
{
2025-05-23 19:00:09 +09:00
public Panel_DataRepository panel_Repository;
2025-05-22 16:12:56 +09:00
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-25 13:24:48 +09:00
public void SetButtonData<T>(string name, StudioEntityWithState<T> data)
2025-05-22 16:12:56 +09:00
{
2025-05-22 18:29:09 +09:00
baseDataKey = name;
2025-05-25 13:24:48 +09:00
dataValue = data as StudioEntityWithState<object>;
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
}
}
}