Info_API 제작
This commit is contained in:
75
Assets/TMPFolder/Panel_Repository.cs
Normal file
75
Assets/TMPFolder/Panel_Repository.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using Studio;
|
||||
using Studio.Setting.Connect;
|
||||
using Studio.UI;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using XRLib.UI;
|
||||
|
||||
namespace XED.UI
|
||||
{
|
||||
public class Panel_Repository : PanelBase
|
||||
{
|
||||
public RectTransform BaseDataList;
|
||||
RectTransform Info_API;
|
||||
RectTransform Info_BaseInfo;
|
||||
|
||||
public UI_BaseDataButton baseDataButtonPrefab;
|
||||
|
||||
TextMeshProUGUI TotalRequestPacketSize;
|
||||
TextMeshProUGUI AverageRequestPacketSize;
|
||||
TextMeshProUGUI TotalResponsePacketSize;
|
||||
TextMeshProUGUI AverageResponsePacketSize;
|
||||
TextMeshProUGUI MaximumResponseTime;
|
||||
TextMeshProUGUI AverageResponseTime;
|
||||
TextMeshProUGUI MaximumRequestPacketAPI;
|
||||
TextMeshProUGUI MaximumResponsePacketAPI;
|
||||
TextMeshProUGUI MaximumResponseTimeAPI;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
UI_ProtocolLabel[] protocolLabels = GetComponentsInChildren<UI_ProtocolLabel>();
|
||||
foreach (UI_ProtocolLabel label in protocolLabels)
|
||||
{
|
||||
label.panel_Repository = this;
|
||||
}
|
||||
|
||||
StudioService.Instance.onDataLoaded += CreateAPIListButton;
|
||||
|
||||
baseDataButtonPrefab = Resources.Load<UI_BaseDataButton>("Prefabs/UI/Button/UI_BaseDataButton");
|
||||
}
|
||||
|
||||
void CreateAPIListButton(string name, StudioEntityWithState<object> value)
|
||||
{
|
||||
var button = Instantiate(baseDataButtonPrefab, BaseDataList.transform);
|
||||
button.panel_Repository = this;
|
||||
button.SetButtonName(name);
|
||||
}
|
||||
|
||||
|
||||
public void ShowInformation_API()
|
||||
{
|
||||
APITotalBoardEntity info = StudioService.Instance.GetAPIStatusBoarder();
|
||||
|
||||
TotalRequestPacketSize.text = info.TotalRequestPacketSize.ToString();
|
||||
AverageRequestPacketSize.text = info.AverageRequestPacketSize.ToString();
|
||||
TotalResponsePacketSize.text = info.TotalResponsePacketSize.ToString();
|
||||
AverageResponsePacketSize.text = info.AverageResponsePacketSize.ToString();
|
||||
MaximumResponseTime.text = info.MaximumResponseTime.ToString();
|
||||
AverageResponseTime.text = info.AverageResponseTime.ToString();
|
||||
MaximumRequestPacketAPI.text = info.MaximumRequestPacketAPI;
|
||||
MaximumResponsePacketAPI.text = info.MaximumResponsePacketAPI;
|
||||
MaximumResponseTimeAPI.text = info.MaximumResponseTimeAPI;
|
||||
|
||||
Info_API.gameObject.SetActive(true);
|
||||
Info_BaseInfo.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void ShowInformation_BaseInfo()
|
||||
{
|
||||
|
||||
|
||||
Info_API.gameObject.SetActive(false);
|
||||
Info_BaseInfo.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user