text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>leton
}
/// <summary>
/// Show the EditorPrefs window
/// </summary>
public void ShowWindow()
{
EditorPrefsWindow.ShowWindow();
}
}
}
<|fim_prefix|>using System;
using MCPForUnity.Editor.Windows;
using UnityEditor;
namespace... | fim | CoplayDev/unity-mcp | csharp |
using System;
using System.Reflection;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditorInternal;
using UnityEditor.SceneManagement;
using UnityEngine;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Maintains a cached readiness ... | fim | CoplayDev/unity-mcp | csharp |
using System;
using System.Threading.Tasks;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Transport;
using MCPForUnity.Editor.Windows;
using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Automatically starts t... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> if (delay > TimeSpan.Zero)
{
McpLog.Debug($"[HTTP Reload] Waiting {delay.TotalSeconds:0.#}s before resume attempt {attempt}");
try { await Task.Delay(delay); }
catch { return; }
}
// Abort r... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System.Threading.Tasks;
using MCPForUnity.Editor.Services.Transport;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Service for controlling the MCP for Unity Bridge connection
/// </summary>
public interface IBridgeControlService
{
/// <summary>
/// Ge... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ram name="attemptAutoRewrite">If true, attempts to auto-fix mismatched paths</param>
/// <returns>True if status changed, false otherwise</returns>
bool CheckClientStatus(IMcpClientConfigurator configurator, bool attemptAutoRewrite = true);
/// <summary>Gets the registry of discov... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> PackageDeploymentResult DeployFromStoredSource();
PackageDeploymentResult RestoreLastBackup();
}
public class PackageDeploymentResult
{
public bool Success { get; set; }
public string Message { get; set; }
public string SourcePath { get; set; }
public... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Service for checking package updates and version information
/// </summary>
public interface IPackageUpdateService
{
/// <summary>
/// Checks if a newer version of the package is available
/// </summary>
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Service for resolving paths to required tools and supporting user overrides
/// </summary>
public interface IPathResolverService
{
/// <summary>
/// Gets the uvx package manager path (respects override if set)
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> Windows
/// </summary>
/// <returns>True if running on Windows</returns>
bool IsWindows();
/// <summary>
/// Gets the SystemRoot environment variable (Windows-specific)
/// </summary>
/// <returns>SystemRoot path, or null if not available</returns>... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ed(string resourceName, bool enabled);
/// <summary>
/// Invalidates the resource discovery cache
/// </summary>
void InvalidateCache();
}
}
<|fim_prefix|>using System.Collections.Generic;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Metadata for ... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Interface for server management operations
/// </summary>
public interface IServerManagementService
{
/// <summary>
/// Clear the local uvx cache for the MCP server package
/// </summary>
/// <ret... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ary>
Task<IReadOnlyList<Dictionary<string, string>>> GetTestsAsync(TestMode? mode);
/// <summary>
/// Execute tests for the supplied mode with optional filtering.
/// </summary>
/// <param name="mode">The test mode (EditMode or PlayMode).</param>
/// <param... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>lName);
/// <summary>
/// Returns only the tools currently enabled for registration
/// </summary>
List<ToolMetadata> GetEnabledTools();
/// <summary>
/// Checks whether a tool is currently enabled for registration
/// </summary>
bool IsToo... | fim | CoplayDev/unity-mcp | csharp |
using System;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Transport;
using MCPForUnity.Editor.Services.Transport.Transports;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Service locator for accessing MCP services without dependency injection
/// </summary>
public st... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Threading.Tasks;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Transport;
using UnityEditor;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Best-effort cleanup when the Unity Editor is quitting.
//... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> if (!string.IsNullOrEmpty(packageRoot))
{
string absolutePath = MakeAbsolute(packageRoot);
if (Directory.Exists(absolutePath))
{
return absolutePath;
}
}
return null;
}
... | fim | CoplayDev/unity-mcp | csharp |
using System;
using System.Collections.Generic;
using System.Linq;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json;
using UnityEditor;
using UnityEditor.PackageManager;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
namespace MCPForUnity.Editor.Services
{
internal enum PackageJobStatus { Runni... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> using (var client = CreateWebClient())
{
client.Headers.Add("User-Agent", "Unity-MCPForUnity-AssetStoreUpdateChecker");
string jsonContent = client.DownloadString(AssetStoreVersionUrl);
var versionJson = JObject.Parse(jsonC... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>gumentException("The selected Claude CLI executable does not exist");
}
EditorPrefs.SetString(EditorPrefKeys.ClaudeCliPathOverride, path);
}
public void ClearUvxPathOverride()
{
EditorPrefs.DeleteKey(EditorPrefKeys.UvxPathOverride);
}
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Default implementation of platform detection service
/// </summary>
public class PlatformService : IPlatformService
{
/// <summary>
/// Checks if the current platform is Windows
/// </summa... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Resources;
using UnityEditor;
namespace MCPForUnity.Editor.Services
{
public class ResourceDiscoveryService : IRes... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>namespace MCPForUnity.Editor.Services.Server
{
/// <summary>
/// Interface for managing PID files and handshake state for the local HTTP server.
/// Handles persistence of server process information across Unity domain reloads.
/// </summary>
public interface IPidFileManager
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System.Collections.Generic;
namespace MCPForUnity.Editor.Services.Server
{
/// <summary>
/// Interface for platform-specific process inspection operations.
/// Provides methods to detect MCP server processes, query process command lines,
/// and find processes listening on specific ... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>namespace MCPForUnity.Editor.Service<|fim_suffix|>nate</param>
/// <returns>True if the process was terminated successfully</returns>
bool Terminate(int pid);
}
}
<|fim_middle|>s.Server
{
/// <summary>
/// Interface for platform-specific process termination.
/// Provides me... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>
/// <summary>
/// Gets the platform-specific PATH prepend string for finding uv/uvx.
/// </summary>
/// <returns>Paths to prepend to PATH environment variable</returns>
string GetPlatformSpecificPathPrepend();
/// <summary>
/// Quotes a string if i... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System.Diagnostics;
namespace MCPForUnity.Editor.Services.Server
{
/// <summary>
/// Interface for launching commands in platform-specific terminal windows.
/// Supports macOS Terminal, Windows cmd, and Linux terminal emulators.
/// </summary>
<|fim_suffix|>nal</returns>
Pr... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using MCPForUnity.Editor.Constants;
using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Services.Server
{
/// <summary>
/// Manages PID files and han... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>orm.WindowsEditor)
{
// Step 1: Check if process name matches known server executables
ExecPath.TryRun("cmd.exe", $"/c tasklist /FI \"PID eq {pid}\"", Application.dataPath, out var tasklistOut, out var tasklistErr, 5000);
string t... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> killPath = "/bin/kill";
if (!File.Exists(killPath)) killPath = "kill";
ExecPath.TryRun(killPath, $"-15 {pid}", Application.dataPath, out stdout, out stderr);
// Wait briefly for graceful shutdown.
var deadline = DateTime.Utc... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>// <inheritdoc/>
public string GetPlatformSpecificPathPrepend()
{
if (Application.platform == RuntimePlatform.OSXEditor)
{
return string.Join(Path.PathSeparator.ToString(), new[]
{
"/opt/homebrew/bin",
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>Window = true
};
#endif
}
}
}
<|fim_prefix|>using System;
using System.IO;
using MCPForUnity.Editor.Helpers;
using UnityEngine;
namespace MCPForUnity.Editor.Services.Server
{
/// <summary>
/// Launches commands in platform-specific terminal windows.
/// Supports macOS ... | fim | CoplayDev/unity-mcp | csharp |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Server;
using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Services
{
/// <summary>
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Reflection;
usi<|fim_suffix|>as a config on disk. Catches the case where the user updated the
/// MCP for Unity package while the Editor was closed — without this sweep, stale package versions in client
/// configs would persist until the user opens the MCP window.
/... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> // Cancel any previous retry loop and create a fresh token.
CancelRetries();
var cts = _retryCts = new CancellationTokenSource();
var token = cts.Token;
Exception lastException = null;
for (int i = 0; i < ResumeRetrySchedule.Length; i++... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json;
using UnityEditor;
using UnityEditorInternal;
using UnityEditor.TestTools.TestRunner.Api;
namespace MCPForUnity.Editor.Services
{
internal enum Tes... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using UnityEditor.TestTools.TestRunner.Api;
namespace MCPForUnity.Editor.Services
{
/// <summary>
/// Thread-safe, minimal shared status fo<|fim_suffix|>ateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
_mode = null;
}
}
}
}
<|fim_middle|>r Uni... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>nfo("[TestRunnerNoThrottle] Recovered from domain reload - reapplying No Throttling.");
ApplyNoThrottling();
}
}
catch (Exception e)
{
McpLog.Warn($"[TestRunnerNoThrottle] Failed to register callbacks: {e}");
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ummaryPayload = new TestRunSummary(
total,
passed,
failed,
skipped,
duration,
summary?.ResultState ?? "Unknown");
return new TestRunResult(summaryPayload, materializedTests);
}
}
p... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Tools;
using UnityEditor;
namespace MCPForUnity.Editor.Services
{
public class ToolDiscoveryService : IToolDiscove... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ask<bool> StartAsync();
Task StopAsync();
Task<bool> VerifyAsync();
Task ReregisterToolsAsync();
}
}
<|fim_prefix|>using System.Threading.Tasks;
namespace MCPForUnity.Editor.Services.Transport
{
/// <summary>
/// Abstraction for MCP transport implementations (e.g. WebS... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Models;
using MCPForUnity.Editor.Services;
using MCPForUnity.Editor.Tools;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEditor;
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Threading.Tasks;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services.Transport.Transports;
namespace MCPForUnity.Editor.Services.Transport
{
/// <summary>
/// Coordinates the active transport client and exposes lifecycle helpers.
/// </summary>
p... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>namespace MCPForUnity.Editor.Services.Transport
{
/// <summary>
/// Lightweight snapshot of a transport's runtime status for editor UI and diagnostics.
/// </summary>
public sealed class TransportState
{
public bool IsConnected { get; }
public string TransportName { get... | fim | CoplayDev/unity-mcp | csharp |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Models;
using MCP... | fim | CoplayDev/unity-mcp | csharp |
using System;
using System.Threading.Tasks;
using MCPForUnity.Editor.Helpers;
namespace MCPForUnity.Editor.Services.Transport.Transports
{
/// <summary>
/// Adapts the existing TCP bridge into the transport abstraction.
/// </summary>
public class StdioTransportClient : IMcpTransportClient
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>r($"[WebSocket] Tool reregistration failed: {ex.Message}");
}
}
private async Task HandleExecuteAsync(JObject payload, CancellationToken token)
{
string commandId = payload.Value<string>("id");
string commandName = payload.Value<string>("name");... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Setup
{
public class McpForUnitySkillInstaller : EditorWindow
{
private const string RepoUrlKey = "UnityMcpSkillSync... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ge}\n\n" +
"You can manually download Microsoft.CodeAnalysis.CSharp from NuGet " +
"and place the DLLs in Assets/Plugins/Roslyn/.",
"OK");
}
}
}
private static byte[] ExtractFileFromZip(byt... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Dependencies;
using MCPForUnity.Editor.Dependencies.Models;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Windows;
using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Setup
{
/// <summary>
/// H... | fim | CoplayDev/unity-mcp | csharp |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Setup
{
public static class SkillSyncService
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using Newtonsoft.Json.Linq;
using MCPForUnity.Editor.Helpers;
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;
namespace MCPForUnity.Editor.Tools.Animation
{
internal static class AnimatorControl
{
public static object Play(JObject @params)
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
using MCPForUnity.Editor.Helpers;
using UnityEngine;
namespace MCPForUnity.Editor.Tools.Animation
{
internal static class <|fim_suffix|> {
found = p;
break;
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>m '{clipPath}'",
data = new
{
clipPath,
removedCount,
remainingCount = events.Count
}
};
}
private static void CreateFoldersRecursive(string folderPath)
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ursive(string folderPath)
{
if (AssetDatabase.IsValidFolder(folderPath))
return;
string parent = Path.GetDirectoryName(folderPath)?.Replace('\\', '/');
if (!string.IsNullOrEmpty(parent) && parent != "Assets" && !AssetDatabase.IsValidFolder(paren... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>r stateMachine = layers[layerIndex].stateMachine;
AnimatorState state = null;
foreach (var s in stateMachine.states)
{
if (s.state.name == stateName)
{
state = s.state;
break;
}
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ll,
speed = state.speed,
isDefault
}
};
}
public static object AddTransition(JObject @params)
{
var controller = LoadController(@params);
if (controller == null)
return Cont... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using Newtonsoft.Json.Linq;
using MCPForUnity.Editor.Helpers;
using UnityEditor;
using UnityEditor.Animations;
namespace MCPForUnity.Editor.Tools.Animation
{
internal static class ControllerLayers
{
public static object AddLayer(JObject @params)
{
string ... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ion: {action}. Valid: create, get_info, add_curve, set_curve, set_vector_curve, create_preset, assign, add_event, remove_event" };
}
}
}
}
<|fim_prefix|>using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using MCPForUnity.Editor.Helpe... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services;
using Newtonsoft.Json.Linq;
using UnityEditor;
namespace MCPForUnity.Editor.Tools
{
/// <summary>
/// Executes mul... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>uid.NewGuid():N}".Substring(0, 16);
public static string CreateBatchId() => $"batch-{Guid.NewGuid():N}".Substring(0, 16);
public static void AddBuildJob(BuildJob job) => _buildJobs[job.JobId] = job;
public static void AddBatchJob(BatchJob job) => _batchJobs[job.JobId] = job;
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>lSize / (1024.0 * 1024.0), 2);
job.TotalErrors = summary.totalErrors;
job.TotalWarnings = summary.totalWarnings;
if (summary.result == BuildResult.Succeeded)
{
job.State = BuildJobState.Succeeded;
}
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Build;
namespace MCPForUnity.Editor.Tools.Build
{
public static class BuildSettingsHelper
{
public static object ReadProperty(string property, NamedBuildTarget namedTarget)
{
switch (p... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using UnityEditor;
using UnityEditor.Build;
namespace MCPForUnity.Editor.Tools.Build
{
public static class BuildTargetMapping
{
private const string VisionOSName = "VisionOS";
public static bool TryResolveBuildTarget(string name, out BuildTarget target)
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Reflection;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Runtime.Helpers;
namespace MCPForUnity.Editor.Tools.Cameras
{
internal static class CameraConfigure
{
#region Tier 1 — Basic Camera
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Runtime.Helpers;
namespace MCPForUnity.Editor.Tools.Cameras
{
internal static class CameraC... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Reflection;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using MCPForUnity.Runtime.Helpers;
namespace MCPForUnity.Editor.Tools.Cameras
{
internal static class CameraCreate
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>}
var go = ResolveGameObjectRef(targetRef);
if (go != null)
SetReflectionProperty(cmCamera, propertyName, go.transform);
}
internal static Type ResolveComponentType(string typeName)
{
return UnityTypeResolver.ResolveComponent(ty... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> return CameraConfigure.SetAim(@params);
case "set_noise":
return CameraConfigure.SetNoise(@params);
case "add_extension":
return CameraConfigure.AddExtension(@params);
case "remove_exten... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Resources;
using MCPForUnity.Runtime.Helpers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MCPForUnity.Edito... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Runtime.Helpers;
using Microsoft.CSharp;
using Newtonsoft.Json.Linq;
using UnityEngine;
namesp... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>.Error($"[MenuItemExecutor] Failed to setup execution for '{menuPath}': {e}");
return new ErrorResponse($"Error setting up execution for menu item '{menuPath}': {e.Message}");
}
}
}
}
<|fim_prefix|>using System;
using System.Collections.Generic;
using MCPForUnity.Ed... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System.Collections.Generic;
using System.Linq;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEngine;
namespace MCPForUnity.Editor.Tools
{
/// <summary>
/// Tool for searching GameObjects in the scene.
/// Returns only instance IDs with pagination support.
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Editor.Helpers;
using UnityEngine;
namespace MC<|fim_suffix|>i - 1, j - 1] + cost);
}
}
return matrix[s1.Length, s2.Length];
}
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>}
FieldInfo finalFieldInfo = currentType.GetField(finalPart, flags);
if (finalFieldInfo != null)
{
object convertedValue = ConvertJTokenToType(value, finalFieldInfo.FieldType, inputSerializer);
if (convertedValue != n... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using System;
using System.Linq;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEditorInternal;
using UnityEngine;
namespace MCPForUnity.Editor.Tools.GameObjects
{
internal static class GameObjectCreate
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using System.Collections.Generic;
using MCPForUnity.Editor.Helper<|fim_suffix|>";
return new SuccessResponse(message, deletedObjects);
}
return new ErrorResponse("Failed to delete target GameObject(s).");
}
}
}
<|fim_middle|>s;
using N... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using MCPForUnity.Runtime.Helpers;
namespace MCPForUnity.Editor.Tools.GameObjects
{
internal static class GameObjectDuplicate
{
internal... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using Newtonsoft.Json.Linq;
namespace MCPForUnity.Editor.Tools.GameObjects
{
internal static class GameObjectHandlers
{
internal static object Create(JObject @params) => GameObjectCreate.Handle(<|fim_suffix|> JToken targetToken, string searchMethod)
=> GameOb... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>erence (name/path/instanceID) to look at
/// look_at_up - Optional up vector [x,y,z], defaults to Vector3.up
/// </summary>
internal static object Handle(JObject @params, JToken targetToken, string searchMethod)
{
GameObject targetGo = ManageGameObjectCommon... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEditorInternal;
using UnityEngine;
namespace MCPForUnity.Editor.Tools.GameObjects
{
inter... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
namespace MCPForUnity.Editor.Tools.GameObjects
{
internal static class GameObjectMoveRelative
{
internal static object Handle(JObject @p... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>tion != "create")
{
targetToken = name;
// We don't update @params["target"] because we use targetToken locally mostly,
// but some downstream methods might parse @params directly. Let's update @params too for safety.
@params["tar... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Tools;
using Newtonsoft.Json.Linq;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
using MCPForUnity.Runtime.Helpers;
na... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services;
using Newtonsoft.Jso<|fim_suffix|>rrorResponse("Unknown job_id.");
}
var payload = TestJobManager.ToSerializable(job, includeDetails, includeFailedTests);
return new SuccessResponse("Tes... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> { prop.enumValueIndex = i; return true; }
}
}
prop.enumValueIndex = ParamCoercion.CoerceInt(value, 0);
return true;
case SerializedPropertyType.ObjectReference... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|> if (string.IsNullOrEmpty(target))
return new ErrorResponse("'target' parameter is required (name or instanceID of a GameObject with LightProbeGroup).");
var go = FindGameObject(target);
if (go == null)
return new ErrorResponse($"GameObject... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using Newtonsoft.Json.Linq;
using MCPForUnity.Editor.Helpers;
namespace MCPForUnity.Editor.Tools.Graphics
{
[McpForUnityTool("manage_graphics", AutoRegister = false, Group = "core")]
public static class ManageGraphics
{
public static object HandleCommand(JObject @params)... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Reflection;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
namespace MCPForUnity.Editor.Tools.Graphics
{
internal static class RenderPipelineOps
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>)
{
var rendererFeaturesPropSo = so.FindProperty("m_RendererFeatures");
if (rendererFeaturesPropSo == null)
return new ErrorResponse("m_RendererFeatures property not found.");
// Read current features
var curr... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ring.Join(", ", Enum.GetNames(typeof(DrawCameraMode)).Take(20));
return new ErrorResponse(
$"'mode' parameter required. Options: {validModes}");
}
if (!Enum.TryParse<DrawCameraMode>(modeName, true, out var drawMode))
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ndDistance = RenderSettings.fogEndDistance
}
};
}
// ---------------------------------------------------------------
// skybox_set_reflection — configure environment reflections
// ---------------------------------------------------------------
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>ng fieldName, JToken value)
{
if (component == null || string.IsNullOrEmpty(fieldName)) return false;
var field = component.GetType().GetField(fieldName,
BindingFlags.Public | BindingFlags.Instance);
if (field == null)
{
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEngine;
namespace MCPForUnity.Editor.Tools
{
internal static class JsonUtil
{
/// <summary>
/// If @params[paramName] is a JSON string, parse it to a JObject in-place.
/// Logs <|fim_suffix|> {
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>h))
return new ErrorResponse($"Source asset not found at path: {sourcePath}");
string destPath;
if (string.IsNullOrEmpty(destinationPath))
{
// Generate a unique path if destination is not provided
destPath = AssetDatabas... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>es = fromStr;
return new SuccessResponse($"Updated build scenes ({fromStr.Length}).", new
{
scenes = fromStr.Select(s => new { path = s.path, enabled = s.enabled }).ToArray()
});
}
}
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using MCPForUnity.Runtime.Helpers;
namespace MCPForUnity.Editor.Tools
{
//... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>lt = MCPServiceLocator.Deployment.RestoreLastBackup();
if (!result.Success)
return new ErrorResponse(result.Message);
return new SuccessResponse(result.Message, new
{
target_path = result.TargetPath,
... | fim | CoplayDev/unity-mcp | csharp |
<|fim_suffix|>= null;
JToken propsToken = @params["properties"];
if (propsToken != null)
{
if (propsToken.Type == JTokenType.String)
{
try { properties = JObject.Parse(propsToken.ToString()); }
catch (Exception e... | fim | CoplayDev/unity-mcp | csharp |
<|fim_prefix|>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using MCPForUnity.Editor.Helpers;
using MCPForUnity.Editor.Services;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEditor.PackageManager;
using Unity... | fim | CoplayDev/unity-mcp | csharp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.