Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions MCPForUnity/Editor/MenuItems/MCPForUnityMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ namespace MCPForUnity.Editor.MenuItems
{
public static class MCPForUnityMenu
{
[MenuItem("Window/MCP For Unity/Setup Window", priority = 1)]
public static void ShowSetupWindow()
{
SetupWindowService.ShowSetupWindow();
}

[MenuItem("Window/MCP For Unity/Toggle MCP Window %#m", priority = 2)]
[MenuItem("Window/MCP For Unity/Toggle MCP Window %#m", priority = 1)]
public static void ToggleMCPWindow()
{
if (MCPForUnityEditorWindow.HasAnyOpenWindow())
Expand All @@ -25,5 +19,18 @@ public static void ToggleMCPWindow()
MCPForUnityEditorWindow.ShowWindow();
}
}

[MenuItem("Window/MCP For Unity/Setup Window", priority = 2)]
public static void ShowSetupWindow()
{
SetupWindowService.ShowSetupWindow();
}


[MenuItem("Window/MCP For Unity/EditorPrefs", priority = 3)]
public static void ShowEditorPrefsWindow()
{
EditorPrefsWindow.ShowWindow();
}
}
}
54 changes: 54 additions & 0 deletions MCPForUnity/Editor/Services/EditorPrefsWindowService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using MCPForUnity.Editor.Windows;
using UnityEditor;

namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Service for managing the EditorPrefs window
/// Follows the Class-level Singleton pattern
/// </summary>
public class EditorPrefsWindowService
{
private static EditorPrefsWindowService _instance;

/// <summary>
/// Get the singleton instance
/// </summary>
public static EditorPrefsWindowService Instance
{
get
{
if (_instance == null)
{
throw new Exception("EditorPrefsWindowService not initialized");
}
return _instance;
}
}

/// <summary>
/// Initialize the service
/// </summary>
public static void Initialize()
{
if (_instance == null)
{
_instance = new EditorPrefsWindowService();
}
}

private EditorPrefsWindowService()
{
// Private constructor for singleton
}

/// <summary>
/// Show the EditorPrefs window
/// </summary>
public void ShowWindow()
{
EditorPrefsWindow.ShowWindow();
}
}
}
11 changes: 11 additions & 0 deletions MCPForUnity/Editor/Services/EditorPrefsWindowService.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions MCPForUnity/Editor/Windows/EditorPrefs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefItem.uxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="True">
<ui:VisualElement class="pref-item">
<ui:VisualElement class="pref-row">
<!-- Key and Known indicator -->
<ui:VisualElement class="key-section">
<ui:Label name="key-label" class="key-label" />
</ui:VisualElement>

<!-- Value field -->
<ui:TextField name="value-field" class="value-field" />

<!-- Type dropdown -->
<ui:DropdownField name="type-dropdown" class="type-dropdown" choices="String,Int,Float,Bool" index="0" />

<!-- Action buttons -->
<ui:VisualElement class="action-buttons">
<ui:Button name="save-button" text="✓" class="save-button" tooltip="Save changes" />
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
10 changes: 10 additions & 0 deletions MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefItem.uxml.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading