43 lines
959 B
C#
43 lines
959 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using Studio.UI;
|
|
using Studio.Setting.Connect;
|
|
using XRLib.UI;
|
|
|
|
|
|
namespace Studio
|
|
{
|
|
public class UI_BaseDataButton : UIBase
|
|
{
|
|
public Panel_DataRepository panel_Repository;
|
|
|
|
Button button;
|
|
TextMeshProUGUI buttonName;
|
|
|
|
string baseDataKey;
|
|
StudioEntityWithState<object> dataValue;
|
|
|
|
private void Awake()
|
|
{
|
|
button = GetComponent<Button>();
|
|
buttonName = GetComponentInChildren<TextMeshProUGUI>();
|
|
|
|
button.onClick.AddListener(OnClickButton);
|
|
}
|
|
|
|
void OnClickButton()
|
|
{
|
|
panel_Repository.ShowInformation_APIData(dataValue);
|
|
}
|
|
|
|
public void SetButtonData<T>(string name, StudioEntityWithState<T> data)
|
|
{
|
|
baseDataKey = name;
|
|
dataValue = data as StudioEntityWithState<object>;
|
|
|
|
buttonName.text = name;
|
|
}
|
|
}
|
|
}
|