DataRepository 오류 수정

This commit is contained in:
geondo55
2025-07-30 15:38:52 +09:00
parent 60ce186a2e
commit 57a5fb3b61
6 changed files with 41 additions and 6 deletions

View File

@@ -314,7 +314,7 @@ MonoBehaviour:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.8235294, g: 0.039215688, b: 0.06666667, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
@@ -347,3 +347,4 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
panel_Repository: {fileID: 0}
bg: {fileID: 0}

View File

@@ -314,7 +314,7 @@ MonoBehaviour:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.8235294, g: 0.039215688, b: 0.06666667, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
@@ -347,3 +347,4 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
panel_Repository: {fileID: 0}
bg: {fileID: 0}

View File

@@ -15,6 +15,7 @@ namespace Studio
public Panel_DataRepository panel_Repository;
Button button;
public Image bg;
TextMeshProUGUI buttonName;
string baseDataKey;
@@ -23,6 +24,7 @@ namespace Studio
private void Awake()
{
button = GetComponent<Button>();
bg = GetComponent<Image>();
buttonName = GetComponentInChildren<TextMeshProUGUI>();
button.onClick.AddListener(OnClickButton);
@@ -31,6 +33,7 @@ namespace Studio
void OnClickButton()
{
panel_Repository.ShowInformation_APIData(baseDataKey, dataValue);
bg.color = new Color32(0xD2, 0x0A, 0x11, 0xFF);
}
public void SetButtonData<T>(string name, StudioEntityWithState<T> data)

View File

@@ -14,6 +14,7 @@ namespace Studio
public Panel_DataRepository panel_Repository;
Button button;
public Image bg;
TextMeshProUGUI buttonName;
string baseDataKey;
@@ -23,6 +24,7 @@ namespace Studio
private void Awake()
{
button = GetComponent<Button>();
bg = GetComponent<Image>();
buttonName = GetComponentInChildren<TextMeshProUGUI>();
button.onClick.AddListener(OnClickButton);
@@ -31,6 +33,7 @@ namespace Studio
void OnClickButton()
{
panel_Repository.ShowInformation_MQTTData(baseDataKey, dataValue, elapsedTime);
bg.color = new Color32(0xD2, 0x0A, 0x11, 0xFF);
}
public void SetButtonData(string name, Dictionary<string, Dictionary<string, string>> data, TimeSpan elapsedTime)

View File

@@ -20,7 +20,9 @@ namespace Studio.UI
public Panel_DataRepository panel_Repository;
public Button ClickButton;
Button FoldButton;
public Image bg;
TextMeshProUGUI buttonText;
UI_DataRepositoryButtonList dataList;
@@ -31,7 +33,7 @@ namespace Studio.UI
{
buttonText = ClickButton.GetComponentInChildren<TextMeshProUGUI>();
dataList = GetComponentInChildren<UI_DataRepositoryButtonList>();
bg = ClickButton.GetComponent<Image>();
ClickButton.onClick.AddListener(OnClickButton);
FoldButton.onClick.AddListener(OnClickFoldButton);
}
@@ -46,6 +48,8 @@ namespace Studio.UI
{
panel_Repository.ShowInformation_MQTT();
}
bg.color = new Color32(0xD2, 0x0A, 0x11, 0xFF);
}
void OnClickFoldButton()
@@ -53,13 +57,13 @@ namespace Studio.UI
if (isFold)
{
dataList.FoldButtons(true);
FoldButton.GetComponent<RectTransform>().localRotation = Quaternion.Euler(0f, 0f, 0f);
FoldButton.GetComponent<RectTransform>().localScale = Vector3.one;
isFold = false;
}
else
{
dataList.FoldButtons(false);
FoldButton.GetComponent<RectTransform>().localRotation = Quaternion.Euler(0f, 0f, 180f);
FoldButton.GetComponent<RectTransform>().localScale = new Vector3(1, -1, 1);
isFold = true;
}
panel_Repository.RebuildLayout();

View File

@@ -34,13 +34,14 @@ namespace Studio
TextMeshProUGUI MaximumResponseTimeAPI;
LayoutGroup[] layoutGroups;
UI_ProtocolLabel[] protocolLabels;
Dictionary<string, UI_BaseDataButton> apiButtons = new();
Dictionary<string, UI_MQTTDataButton> mqttButtons = new();
public override void AfterAwake()
{
UI_ProtocolLabel[] protocolLabels = GetComponentsInChildren<UI_ProtocolLabel>();
protocolLabels = GetComponentsInChildren<UI_ProtocolLabel>();
foreach (UI_ProtocolLabel label in protocolLabels)
{
label.panel_Repository = this;
@@ -132,6 +133,7 @@ namespace Studio
Panel_APIDataInfo.gameObject.SetActive(false);
Panel_MQTTInfo.gameObject.SetActive(false);
Panel_MQTTDataInfo.gameObject.SetActive(false);
ResetButtonColor();
if (info == null)
return;
@@ -162,6 +164,7 @@ namespace Studio
Panel_APIDataInfo.gameObject.SetActive(true);
Panel_MQTTInfo.gameObject.SetActive(false);
Panel_MQTTDataInfo.gameObject.SetActive(false);
ResetButtonColor();
}
public void ShowInformation_MQTT()
@@ -170,6 +173,7 @@ namespace Studio
Panel_APIDataInfo.gameObject.SetActive(false);
Panel_MQTTInfo.gameObject.SetActive(true);
Panel_MQTTDataInfo.gameObject.SetActive(false);
ResetButtonColor();
}
public void ShowInformation_MQTTData(string name, Dictionary<string, Dictionary<string, string>> data, TimeSpan elapsedTime)
@@ -180,11 +184,30 @@ namespace Studio
Panel_APIDataInfo.gameObject.SetActive(false);
Panel_MQTTInfo.gameObject.SetActive(false);
Panel_MQTTDataInfo.gameObject.SetActive(true);
ResetButtonColor();
}
void Deactivate()
{
gameObject.SetActive(false);
}
private void ResetButtonColor()
{
foreach (UI_ProtocolLabel label in protocolLabels)
{
label.bg.color = Color.white;
}
foreach (var btn in apiButtons.Values)
{
btn.bg.color = Color.white;
}
foreach (var btn in mqttButtons.Values)
{
btn.bg.color = Color.white;
}
}
}
}