Skip to content

Commit ba35a47

Browse files
committed
feat: add dynamic version display in editor window settings
1 parent f5d56de commit ba35a47

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

MCPForUnity/Editor/Windows/MCPForUnityEditorWindowNew.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ private enum ConnectionProtocol
2424
}
2525

2626
// Settings UI Elements
27+
private Label versionLabel;
2728
private Toggle debugLogsToggle;
2829
private EnumField validationLevelField;
2930
private Label validationDescription;
@@ -191,6 +192,7 @@ private void RefreshAllData()
191192
private void CacheUIElements()
192193
{
193194
// Settings
195+
versionLabel = rootVisualElement.Q<Label>("version-label");
194196
debugLogsToggle = rootVisualElement.Q<Toggle>("debug-logs-toggle");
195197
validationLevelField = rootVisualElement.Q<EnumField>("validation-level");
196198
validationDescription = rootVisualElement.Q<Label>("validation-description");
@@ -240,6 +242,7 @@ private void CacheUIElements()
240242
private void InitializeUI()
241243
{
242244
// Settings Section
245+
versionLabel.text = AssetPathUtility.GetPackageVersion();
243246
debugLogsToggle.value = EditorPrefs.GetBool("MCPForUnity.DebugLogs", false);
244247

245248
validationLevelField.Init(ValidationLevel.Standard);

MCPForUnity/Editor/Windows/MCPForUnityEditorWindowNew.uxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ui:VisualElement class="section-content">
1010
<ui:VisualElement class="setting-row">
1111
<ui:Label text="Version:" class="setting-label" />
12-
<ui:Label text="5.0.0" name="version-label" class="setting-value" />
12+
<ui:Label text="..." name="version-label" class="setting-value" />
1313
</ui:VisualElement>
1414
<ui:VisualElement class="setting-row">
1515
<ui:Label text="Show Debug Logs:" class="setting-label" />

0 commit comments

Comments
 (0)