From 65e68ebed54ee8df7a1d2918061fd45084cf7f61 Mon Sep 17 00:00:00 2001 From: Ivan Murzak Date: Tue, 19 May 2026 16:35:23 -0700 Subject: [PATCH] feat(skills): add SkillDescription/SkillBody to ParticleSystem tools Mirrors Unity-MCP PR #758. Bumps the com.ivanmurzak.unity.mcp dependency to 0.72.2 (which introduced [McpPluginSkillDescription] and [McpPluginSkillBody]) and decorates particle-system-get and particle-system-modify with both attributes. The [Description] payload is left byte-identical to main so the MCP tools/list wire response does not change. Regenerate SKILL.md files via unity-skill-generate. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Scripts/Tools/ParticleSystem.Get.cs | 27 +++++++++++++++++++ .../Scripts/Tools/ParticleSystem.Modify.cs | 22 +++++++++++++++ Unity-Package/Assets/root/package.json | 2 +- Unity-Package/Packages/manifest.json | 2 +- 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Get.cs b/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Get.cs index e207f78..528dec4 100644 --- a/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Get.cs +++ b/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Get.cs @@ -33,6 +33,33 @@ public partial class Tool_ParticleSystem IdempotentHint = true, OpenWorldHint = false )] + [McpPluginSkillDescription("Inspect a `UnityEngine.ParticleSystem` component on a GameObject — runtime state " + + "(playing/paused/emitting/stopped, particle count, time) plus opt-in serialized data for any of the " + + "~24 particle modules (Main, Emission, Shape, Velocity, Noise, Collision, Trails, Renderer, etc.). " + + "Pair with '" + ParticleSystemModifyToolId + "' to write changes back.")] + [McpPluginSkillBody("Inspect a `UnityEngine.ParticleSystem` component on a GameObject. Returns runtime state " + + "(`isPlaying`, `isPaused`, `isEmitting`, `isStopped`, `particleCount`, `time`) plus opt-in serialized data " + + "for any of the particle modules. Use '" + ParticleSystemModifyToolId + "' afterwards to write changes back.\n\n" + + "## Inputs\n\n" + + "- `gameObjectRef` — the GameObject hosting the `ParticleSystem` component (required).\n" + + "- `componentRef` — optional. Resolves a specific `ParticleSystem` when the GameObject has more than " + + "one; otherwise the first `ParticleSystem` found is used.\n" + + "- `includeMain`, `includeEmission`, `includeShape`, `includeVelocityOverLifetime`, " + + "`includeLimitVelocityOverLifetime`, `includeInheritVelocity`, `includeLifetimeByEmitterSpeed`, " + + "`includeForceOverLifetime`, `includeColorOverLifetime`, `includeColorBySpeed`, " + + "`includeSizeOverLifetime`, `includeSizeBySpeed`, `includeRotationOverLifetime`, " + + "`includeRotationBySpeed`, `includeExternalForces`, `includeNoise`, `includeCollision`, " + + "`includeTrigger`, `includeSubEmitters`, `includeTextureSheetAnimation`, `includeLights`, " + + "`includeTrails`, `includeCustomData`, `includeRenderer` — per-module toggles. `includeMain` defaults " + + "to `true`; everything else defaults to `false`.\n" + + "- `includeAll` — when `true`, overrides every per-module flag and emits all modules.\n" + + "- `deepSerialization` — when `true`, recurses through nested objects via ReflectorNet; otherwise only " + + "top-level members are serialized (cheaper, smaller payload).\n\n" + + "## Behavior\n\n" + + "Only the modules whose include-flags resolve to `true` are serialized — this keeps responses small " + + "when you only need one or two modules. `includeRenderer` reads the sibling " + + "`UnityEngine.ParticleSystemRenderer` component on the same GameObject and is skipped silently when " + + "no renderer is present. The whole call runs on the Unity main thread.")] [Description("Get detailed information about a ParticleSystem component on a GameObject. " + "Returns particle system state and optionally serialized data for each module. " + "Use the boolean flags to request specific modules. " + diff --git a/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Modify.cs b/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Modify.cs index dca4348..f7c17ec 100644 --- a/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Modify.cs +++ b/Unity-Package/Assets/root/Editor/Scripts/Tools/ParticleSystem.Modify.cs @@ -37,6 +37,28 @@ public partial class Tool_ParticleSystem IdempotentHint = true, OpenWorldHint = false )] + [McpPluginSkillDescription("Modify a `UnityEngine.ParticleSystem` component on a GameObject. Pass " + + "`SerializedMember` payloads only for the modules you want to change; everything else is left alone. " + + "Use '" + ParticleSystemGetToolId + "' first to inspect the current structure.")] + [McpPluginSkillBody("Modify a `UnityEngine.ParticleSystem` component on a GameObject. Pass `SerializedMember` " + + "payloads only for the modules you want to change; omitted modules are left untouched. Use " + + "'" + ParticleSystemGetToolId + "' first to inspect the current structure so the diff is targeted.\n\n" + + "## Inputs\n\n" + + "- `gameObjectRef` — the GameObject hosting the `ParticleSystem` component (required).\n" + + "- `componentRef` — optional. Resolves a specific `ParticleSystem` when the GameObject has more than " + + "one; otherwise the first `ParticleSystem` found is used.\n" + + "- `main`, `emission`, `shape`, `velocityOverLifetime`, `limitVelocityOverLifetime`, " + + "`inheritVelocity`, `lifetimeByEmitterSpeed`, `forceOverLifetime`, `colorOverLifetime`, `colorBySpeed`, " + + "`sizeOverLifetime`, `sizeBySpeed`, `rotationOverLifetime`, `rotationBySpeed`, `externalForces`, " + + "`noise`, `collision`, `trigger`, `subEmitters`, `textureSheetAnimation`, `lights`, `trails`, " + + "`customData`, `renderer` — optional `SerializedMember` payloads per module. Include only the " + + "properties you want to change.\n\n" + + "## Behavior\n\n" + + "Each non-null module is applied via `Reflector.TryModify` and logged with a `[ModuleName]` prefix in " + + "the response's `logs` array. The `renderer` payload targets the sibling " + + "`UnityEngine.ParticleSystemRenderer` component on the same GameObject; if absent, the call logs the " + + "miss instead of throwing. When at least one module was modified, the GameObject and the " + + "`ParticleSystem` are marked dirty so the change persists. The whole call runs on the Unity main thread.")] [Description("Modify a ParticleSystem component on a GameObject. " + "Provide the data model with only the modules you want to change. " + "Use '" + ParticleSystemGetToolId + "' first to inspect the ParticleSystem structure before modifying. " + diff --git a/Unity-Package/Assets/root/package.json b/Unity-Package/Assets/root/package.json index c7f238f..049375f 100644 --- a/Unity-Package/Assets/root/package.json +++ b/Unity-Package/Assets/root/package.json @@ -28,7 +28,7 @@ "unity": "2022.3", "description": "AI-powered tools for Unity ParticleSystem workflow. Inspect and modify ParticleSystem components via natural language commands—configure emission, shape, velocity curves, color gradients, and all modules without manual inspector navigation. Ideal for rapid prototyping and procedural effects generation. Built on top of the AI Game Developer (Unity-MCP) platform.", "dependencies": { - "com.ivanmurzak.unity.mcp": "0.72.1", + "com.ivanmurzak.unity.mcp": "0.72.2", "com.unity.modules.particlesystem": "1.0.0" }, "scopedRegistries": [ diff --git a/Unity-Package/Packages/manifest.json b/Unity-Package/Packages/manifest.json index 384323b..de6eedf 100644 --- a/Unity-Package/Packages/manifest.json +++ b/Unity-Package/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.ivanmurzak.unity.mcp": "0.72.1", + "com.ivanmurzak.unity.mcp": "0.72.2", "com.unity.ide.visualstudio": "2.0.26", "com.unity.test-framework": "1.1.33", "com.unity.modules.assetbundle": "1.0.0",