API 버튼 업데이트
This commit is contained in:
273
Assets/Resources/Prefabs/UI/Button/UI_MQTTDataButton.prefab
Normal file
273
Assets/Resources/Prefabs/UI/Button/UI_MQTTDataButton.prefab
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &3405020781819431025
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 8412137011264621783}
|
||||||
|
- component: {fileID: 8159438064414966758}
|
||||||
|
- component: {fileID: 9166822912208899419}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Text (TMP)
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &8412137011264621783
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3405020781819431025}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 492208786282724824}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &8159438064414966758
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3405020781819431025}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &9166822912208899419
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3405020781819431025}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_text: Button
|
||||||
|
m_isRightToLeft: 0
|
||||||
|
m_fontAsset: {fileID: 11400000, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
|
||||||
|
m_sharedMaterial: {fileID: 6975767319296004534, guid: 4f170a218dfffe4489dc7ddd54bc15cf, type: 2}
|
||||||
|
m_fontSharedMaterials: []
|
||||||
|
m_fontMaterial: {fileID: 0}
|
||||||
|
m_fontMaterials: []
|
||||||
|
m_fontColor32:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4281479730
|
||||||
|
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||||
|
m_enableVertexGradient: 0
|
||||||
|
m_colorMode: 3
|
||||||
|
m_fontColorGradient:
|
||||||
|
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_fontColorGradientPreset: {fileID: 0}
|
||||||
|
m_spriteAsset: {fileID: 0}
|
||||||
|
m_tintAllSprites: 0
|
||||||
|
m_StyleSheet: {fileID: 0}
|
||||||
|
m_TextStyleHashCode: -1183493901
|
||||||
|
m_overrideHtmlColors: 0
|
||||||
|
m_faceColor:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294967295
|
||||||
|
m_fontSize: 24
|
||||||
|
m_fontSizeBase: 24
|
||||||
|
m_fontWeight: 400
|
||||||
|
m_enableAutoSizing: 0
|
||||||
|
m_fontSizeMin: 18
|
||||||
|
m_fontSizeMax: 72
|
||||||
|
m_fontStyle: 0
|
||||||
|
m_HorizontalAlignment: 2
|
||||||
|
m_VerticalAlignment: 512
|
||||||
|
m_textAlignment: 65535
|
||||||
|
m_characterSpacing: 0
|
||||||
|
m_wordSpacing: 0
|
||||||
|
m_lineSpacing: 0
|
||||||
|
m_lineSpacingMax: 0
|
||||||
|
m_paragraphSpacing: 0
|
||||||
|
m_charWidthMaxAdj: 0
|
||||||
|
m_TextWrappingMode: 1
|
||||||
|
m_wordWrappingRatios: 0.4
|
||||||
|
m_overflowMode: 0
|
||||||
|
m_linkedTextComponent: {fileID: 0}
|
||||||
|
parentLinkedComponent: {fileID: 0}
|
||||||
|
m_enableKerning: 0
|
||||||
|
m_ActiveFontFeatures: 6e72656b
|
||||||
|
m_enableExtraPadding: 0
|
||||||
|
checkPaddingRequired: 0
|
||||||
|
m_isRichText: 1
|
||||||
|
m_EmojiFallbackSupport: 1
|
||||||
|
m_parseCtrlCharacters: 1
|
||||||
|
m_isOrthographic: 1
|
||||||
|
m_isCullingEnabled: 0
|
||||||
|
m_horizontalMapping: 0
|
||||||
|
m_verticalMapping: 0
|
||||||
|
m_uvLineOffset: 0
|
||||||
|
m_geometrySortingOrder: 0
|
||||||
|
m_IsTextObjectScaleStatic: 0
|
||||||
|
m_VertexBufferAutoSizeReduction: 0
|
||||||
|
m_useMaxVisibleDescender: 1
|
||||||
|
m_pageToDisplay: 1
|
||||||
|
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_isUsingLegacyAnimationComponent: 0
|
||||||
|
m_isVolumetricText: 0
|
||||||
|
m_hasFontAssetChanged: 0
|
||||||
|
m_baseMaterial: {fileID: 0}
|
||||||
|
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
--- !u!1 &7120439171255577409
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 492208786282724824}
|
||||||
|
- component: {fileID: 6921339540054383559}
|
||||||
|
- component: {fileID: 3266175959788972596}
|
||||||
|
- component: {fileID: 1002195081819726276}
|
||||||
|
- component: {fileID: 4913199175366641637}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: UI_MQTTDataButton
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &492208786282724824
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7120439171255577409}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 8412137011264621783}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 188, y: 30}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &6921339540054383559
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7120439171255577409}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &3266175959788972596
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7120439171255577409}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_Type: 1
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!114 &1002195081819726276
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7120439171255577409}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Navigation:
|
||||||
|
m_Mode: 3
|
||||||
|
m_WrapAround: 0
|
||||||
|
m_SelectOnUp: {fileID: 0}
|
||||||
|
m_SelectOnDown: {fileID: 0}
|
||||||
|
m_SelectOnLeft: {fileID: 0}
|
||||||
|
m_SelectOnRight: {fileID: 0}
|
||||||
|
m_Transition: 1
|
||||||
|
m_Colors:
|
||||||
|
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.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
|
||||||
|
m_SpriteState:
|
||||||
|
m_HighlightedSprite: {fileID: 0}
|
||||||
|
m_PressedSprite: {fileID: 0}
|
||||||
|
m_SelectedSprite: {fileID: 0}
|
||||||
|
m_DisabledSprite: {fileID: 0}
|
||||||
|
m_AnimationTriggers:
|
||||||
|
m_NormalTrigger: Normal
|
||||||
|
m_HighlightedTrigger: Highlighted
|
||||||
|
m_PressedTrigger: Pressed
|
||||||
|
m_SelectedTrigger: Selected
|
||||||
|
m_DisabledTrigger: Disabled
|
||||||
|
m_Interactable: 1
|
||||||
|
m_TargetGraphic: {fileID: 3266175959788972596}
|
||||||
|
m_OnClick:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
--- !u!114 &4913199175366641637
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7120439171255577409}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 654b527f256c4fe4183e776d447011e1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
panel_Repository: {fileID: 0}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 87ac5d54aeb766a489f51e426b903e17
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -44,7 +44,7 @@ namespace Studio
|
|||||||
|
|
||||||
public Dictionary<string, StudioEntityWithState<object>> baseData = new();
|
public Dictionary<string, StudioEntityWithState<object>> baseData = new();
|
||||||
|
|
||||||
public event Action<string, StudioEntityWithState<object>> onDataLoaded;
|
public event Action<string, StudioEntityWithState<object>> onAPIDataLoaded;
|
||||||
|
|
||||||
//private string
|
//private string
|
||||||
private StudioService(StudioRepoistory repository)
|
private StudioService(StudioRepoistory repository)
|
||||||
@@ -158,7 +158,7 @@ namespace Studio
|
|||||||
Debug.Log($"APIState : Error , Message :{data.Message}");
|
Debug.Log($"APIState : Error , Message :{data.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
onDataLoaded?.Invoke(url, data);
|
onAPIDataLoaded?.Invoke(url, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckAPIBoarder(string data, int reqSize, string url, long time)
|
private void CheckAPIBoarder(string data, int reqSize, string url, long time)
|
||||||
|
|||||||
@@ -8,17 +8,20 @@ using XRLib.UI;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Best.HTTP.JSON;
|
using Best.HTTP.JSON;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace XED.UI
|
namespace XED.UI
|
||||||
{
|
{
|
||||||
public class Panel_Repository : PanelBase
|
public class Panel_Repository : PanelBase
|
||||||
{
|
{
|
||||||
RectTransform ProtocolLabels;
|
UI_BaseDataButton apiDataButtonPrefab;
|
||||||
RectTransform BaseDataList;
|
UI_MQTTDataButton mqttDataButtonPrefab;
|
||||||
RectTransform Info_API;
|
|
||||||
RectTransform Info_BaseInfo;
|
|
||||||
|
|
||||||
public UI_BaseDataButton baseDataButtonPrefab;
|
UI_DataRepositoryButtonList APIDataList;
|
||||||
|
RectTransform Info_API;
|
||||||
|
RectTransform Info_Basedata;
|
||||||
|
RectTransform Info_MQTT;
|
||||||
|
RectTransform Info_MQTTdata;
|
||||||
|
|
||||||
TextMeshProUGUI TotalRequestPacketSize;
|
TextMeshProUGUI TotalRequestPacketSize;
|
||||||
TextMeshProUGUI AverageRequestPacketSize;
|
TextMeshProUGUI AverageRequestPacketSize;
|
||||||
@@ -41,6 +44,10 @@ namespace XED.UI
|
|||||||
TextMeshProUGUI LastResponseTime;
|
TextMeshProUGUI LastResponseTime;
|
||||||
TextMeshProUGUI ElapsedTime;
|
TextMeshProUGUI ElapsedTime;
|
||||||
|
|
||||||
|
LayoutGroup[] layoutGroups;
|
||||||
|
|
||||||
|
Dictionary<string, UI_BaseDataButton> apiButtons = new();
|
||||||
|
|
||||||
public override void AfterAwake()
|
public override void AfterAwake()
|
||||||
{
|
{
|
||||||
UI_ProtocolLabel[] protocolLabels = GetComponentsInChildren<UI_ProtocolLabel>();
|
UI_ProtocolLabel[] protocolLabels = GetComponentsInChildren<UI_ProtocolLabel>();
|
||||||
@@ -49,28 +56,47 @@ namespace XED.UI
|
|||||||
label.panel_Repository = this;
|
label.panel_Repository = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
StudioService.Instance.onDataLoaded += CreateAPIListButton;
|
StudioService.Instance.onAPIDataLoaded += CreateAPIDataButton;
|
||||||
|
|
||||||
baseDataButtonPrefab = Resources.Load<UI_BaseDataButton>("Prefabs/UI/Button/UI_BaseDataButton");
|
apiDataButtonPrefab = Resources.Load<UI_BaseDataButton>("Prefabs/UI/Button/UI_BaseDataButton");
|
||||||
|
mqttDataButtonPrefab = Resources.Load<UI_MQTTDataButton>("Prefabs/UI/Button/UI_MQTTDataButton");
|
||||||
|
|
||||||
|
layoutGroups = GetComponentsInChildren<LayoutGroup>();
|
||||||
rawDataRect = RawData.GetComponent<RectTransform>();
|
rawDataRect = RawData.GetComponent<RectTransform>();
|
||||||
rawDataFoldHeight = rawDataRect.sizeDelta.y;
|
rawDataFoldHeight = rawDataRect.sizeDelta.y;
|
||||||
RawDataFoldButton.GetComponent<Button>().onClick.AddListener(OnClickRawDataFoldButton);
|
RawDataFoldButton.GetComponent<Button>().onClick.AddListener(OnClickRawDataFoldButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateAPIListButton(string name, StudioEntityWithState<object> value)
|
void CreateAPIDataButton(string name, StudioEntityWithState<object> value)
|
||||||
{
|
{
|
||||||
var button = Instantiate(baseDataButtonPrefab, BaseDataList.transform);
|
if (!apiButtons.ContainsKey(name))
|
||||||
button.panel_Repository = this;
|
{
|
||||||
button.SetButtonData(name, value);
|
// 버튼 새로 생성
|
||||||
|
var button = Instantiate(apiDataButtonPrefab, APIDataList.transform);
|
||||||
|
apiButtons.Add(name, button);
|
||||||
|
button.panel_Repository = this;
|
||||||
|
button.SetButtonData(name, value);
|
||||||
|
|
||||||
RebuildLayout();
|
RebuildLayout();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 버튼 데이터 업데이트
|
||||||
|
apiButtons[name].SetButtonData(name, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildLayout()
|
void CreateMQTTDataButton()
|
||||||
{
|
{
|
||||||
LayoutRebuilder.ForceRebuildLayoutImmediate(BaseDataList);
|
|
||||||
LayoutRebuilder.ForceRebuildLayoutImmediate(ProtocolLabels);
|
}
|
||||||
|
|
||||||
|
public void RebuildLayout()
|
||||||
|
{
|
||||||
|
foreach (var layout in layoutGroups)
|
||||||
|
{
|
||||||
|
LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowInformation_API()
|
public void ShowInformation_API()
|
||||||
@@ -88,10 +114,12 @@ namespace XED.UI
|
|||||||
MaximumResponseTimeAPI.text = info.MaximumResponseTimeAPI;
|
MaximumResponseTimeAPI.text = info.MaximumResponseTimeAPI;
|
||||||
|
|
||||||
Info_API.gameObject.SetActive(true);
|
Info_API.gameObject.SetActive(true);
|
||||||
Info_BaseInfo.gameObject.SetActive(false);
|
Info_Basedata.gameObject.SetActive(false);
|
||||||
|
Info_MQTT.gameObject.SetActive(false);
|
||||||
|
Info_MQTTdata.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowInformation_BaseInfo(StudioEntityWithState<object> baseDataValue)
|
public void ShowInformation_APIData(StudioEntityWithState<object> baseDataValue)
|
||||||
{
|
{
|
||||||
RawData.text = JsonConvert.SerializeObject(baseDataValue.Entity, Formatting.Indented);
|
RawData.text = JsonConvert.SerializeObject(baseDataValue.Entity, Formatting.Indented);
|
||||||
|
|
||||||
@@ -115,7 +143,27 @@ namespace XED.UI
|
|||||||
ElapsedTime.text = $"{minutes:D2}:{seconds:D2}.{milliseconds:D3}";
|
ElapsedTime.text = $"{minutes:D2}:{seconds:D2}.{milliseconds:D3}";
|
||||||
|
|
||||||
Info_API.gameObject.SetActive(false);
|
Info_API.gameObject.SetActive(false);
|
||||||
Info_BaseInfo.gameObject.SetActive(true);
|
Info_Basedata.gameObject.SetActive(true);
|
||||||
|
Info_MQTT.gameObject.SetActive(false);
|
||||||
|
Info_MQTTdata.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowInformation_MQTT()
|
||||||
|
{
|
||||||
|
|
||||||
|
Info_API.gameObject.SetActive(false);
|
||||||
|
Info_Basedata.gameObject.SetActive(false);
|
||||||
|
Info_MQTT.gameObject.SetActive(true);
|
||||||
|
Info_MQTTdata.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowInformation_MQTTData()
|
||||||
|
{
|
||||||
|
|
||||||
|
Info_API.gameObject.SetActive(false);
|
||||||
|
Info_Basedata.gameObject.SetActive(false);
|
||||||
|
Info_MQTT.gameObject.SetActive(false);
|
||||||
|
Info_MQTTdata.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnClickRawDataFoldButton()
|
void OnClickRawDataFoldButton()
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,11 +3,12 @@ using UnityEngine;
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XED.UI;
|
using XED.UI;
|
||||||
using Studio.Setting.Connect;
|
using Studio.Setting.Connect;
|
||||||
|
using XRLib.UI;
|
||||||
|
|
||||||
|
|
||||||
namespace XED
|
namespace XED
|
||||||
{
|
{
|
||||||
public class UI_BaseDataButton : MonoBehaviour
|
public class UI_BaseDataButton : UIBase
|
||||||
{
|
{
|
||||||
public Panel_Repository panel_Repository;
|
public Panel_Repository panel_Repository;
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ namespace XED
|
|||||||
TextMeshProUGUI buttonName;
|
TextMeshProUGUI buttonName;
|
||||||
|
|
||||||
string baseDataKey;
|
string baseDataKey;
|
||||||
StudioEntityWithState<object> baseDataValue;
|
StudioEntityWithState<object> apiDataValue;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
@@ -27,13 +28,13 @@ namespace XED
|
|||||||
|
|
||||||
void OnClickButton()
|
void OnClickButton()
|
||||||
{
|
{
|
||||||
panel_Repository.ShowInformation_BaseInfo(baseDataValue);
|
panel_Repository.ShowInformation_APIData(apiDataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetButtonData(string name, StudioEntityWithState<object> data)
|
public void SetButtonData(string name, StudioEntityWithState<object> data)
|
||||||
{
|
{
|
||||||
baseDataKey = name;
|
baseDataKey = name;
|
||||||
baseDataValue = data;
|
apiDataValue = data;
|
||||||
|
|
||||||
buttonName.text = name;
|
buttonName.text = name;
|
||||||
}
|
}
|
||||||
|
|||||||
25
Assets/TMPFolder/UI_DataRepositoryButtonList.cs
Normal file
25
Assets/TMPFolder/UI_DataRepositoryButtonList.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Studio;
|
||||||
|
using Studio.Setting.Connect;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace XED
|
||||||
|
{
|
||||||
|
public class UI_DataRepositoryButtonList : MonoBehaviour
|
||||||
|
{
|
||||||
|
RectTransform rect;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
rect = GetComponent<RectTransform>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FoldButtons(bool isFold)
|
||||||
|
{
|
||||||
|
foreach (Transform button in rect.transform)
|
||||||
|
{
|
||||||
|
button.gameObject.SetActive(isFold);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/TMPFolder/UI_DataRepositoryButtonList.cs.meta
Normal file
2
Assets/TMPFolder/UI_DataRepositoryButtonList.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8d56a0a1462fa174e9bd6db7924a3b20
|
||||||
41
Assets/TMPFolder/UI_MQTTDataButton.cs
Normal file
41
Assets/TMPFolder/UI_MQTTDataButton.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using Studio.Setting.Connect;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using XED.UI;
|
||||||
|
using XRLib.UI;
|
||||||
|
|
||||||
|
namespace XED
|
||||||
|
{
|
||||||
|
public class UI_MQTTDataButton : UIBase
|
||||||
|
{
|
||||||
|
public Panel_Repository panel_Repository;
|
||||||
|
|
||||||
|
Button button;
|
||||||
|
TextMeshProUGUI buttonName;
|
||||||
|
|
||||||
|
string baseDataKey;
|
||||||
|
StudioEntityWithState<object> baseDataValue;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
button = GetComponent<Button>();
|
||||||
|
buttonName = GetComponentInChildren<TextMeshProUGUI>();
|
||||||
|
|
||||||
|
button.onClick.AddListener(OnClickButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnClickButton()
|
||||||
|
{
|
||||||
|
panel_Repository.ShowInformation_MQTTData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetButtonData(string name, StudioEntityWithState<object> data)
|
||||||
|
{
|
||||||
|
baseDataKey = name;
|
||||||
|
baseDataValue = data;
|
||||||
|
|
||||||
|
buttonName.text = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/TMPFolder/UI_MQTTDataButton.cs.meta
Normal file
2
Assets/TMPFolder/UI_MQTTDataButton.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 654b527f256c4fe4183e776d447011e1
|
||||||
@@ -3,22 +3,35 @@ using TMPro;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XRLib.UI;
|
using XRLib.UI;
|
||||||
|
using static UnityEngine.Analytics.IAnalytic;
|
||||||
|
|
||||||
namespace XED.UI
|
namespace XED.UI
|
||||||
{
|
{
|
||||||
|
public enum ProtocolType
|
||||||
|
{
|
||||||
|
API,
|
||||||
|
MQTT,
|
||||||
|
}
|
||||||
|
|
||||||
public class UI_ProtocolLabel : UIBase
|
public class UI_ProtocolLabel : UIBase
|
||||||
{
|
{
|
||||||
|
public ProtocolType protocolType;
|
||||||
|
|
||||||
public Panel_Repository panel_Repository;
|
public Panel_Repository panel_Repository;
|
||||||
|
|
||||||
Button ClickButton;
|
Button ClickButton;
|
||||||
Button FoldButton;
|
Button FoldButton;
|
||||||
TextMeshProUGUI buttonText;
|
TextMeshProUGUI buttonText;
|
||||||
|
|
||||||
|
UI_DataRepositoryButtonList dataList;
|
||||||
|
|
||||||
string buttonName;
|
string buttonName;
|
||||||
|
bool isFold;
|
||||||
|
|
||||||
public override void AfterAwake()
|
public override void AfterAwake()
|
||||||
{
|
{
|
||||||
buttonText = ClickButton.GetComponentInChildren<TextMeshProUGUI>();
|
buttonText = ClickButton.GetComponentInChildren<TextMeshProUGUI>();
|
||||||
|
dataList = GetComponentInChildren<UI_DataRepositoryButtonList>();
|
||||||
|
|
||||||
ClickButton.onClick.AddListener(OnClickButton);
|
ClickButton.onClick.AddListener(OnClickButton);
|
||||||
FoldButton.onClick.AddListener(OnClickFoldButton);
|
FoldButton.onClick.AddListener(OnClickFoldButton);
|
||||||
@@ -26,12 +39,31 @@ namespace XED.UI
|
|||||||
|
|
||||||
void OnClickButton()
|
void OnClickButton()
|
||||||
{
|
{
|
||||||
panel_Repository.ShowInformation_API();
|
if (protocolType == ProtocolType.API)
|
||||||
|
{
|
||||||
|
panel_Repository.ShowInformation_API();
|
||||||
|
}
|
||||||
|
else if(protocolType == ProtocolType.MQTT)
|
||||||
|
{
|
||||||
|
panel_Repository.ShowInformation_MQTT();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnClickFoldButton()
|
void OnClickFoldButton()
|
||||||
{
|
{
|
||||||
|
if (isFold)
|
||||||
|
{
|
||||||
|
dataList.FoldButtons(true);
|
||||||
|
FoldButton.GetComponent<RectTransform>().localRotation = Quaternion.Euler(0f, 0f, 0f);
|
||||||
|
isFold = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataList.FoldButtons(false);
|
||||||
|
FoldButton.GetComponent<RectTransform>().localRotation = Quaternion.Euler(0f, 0f, 180f);
|
||||||
|
isFold = true;
|
||||||
|
}
|
||||||
|
panel_Repository.RebuildLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetButtonName(string name)
|
public void SetButtonName(string name)
|
||||||
|
|||||||
Reference in New Issue
Block a user