script-update-or-create

Create or update Unity C# script files and report syntax errors.

3.8k|349|Updated Apr 2, 2025
One-click install
npx skills add https://github.com/IvanMurzak/Unity-MCP --skill script-update-or-create-ivanmurzak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: script-update-or-create
Source: https://github.com/IvanMurzak/Unity-MCP/tree/main/Unity-MCP-Plugin/.claude/skills/script-update-or-create
Command: npx skills add https://github.com/IvanMurzak/Unity-MCP --skill script-update-or-create-ivanmurzak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation and updating of a Unity C# script file at a specified path, ensuring AssetDatabase.Refresh() is called and compilation errors are reported when present.

Core Features & Use Cases

  • Create or update a script file at a given path with provided C# content.
  • Automatically refresh the Unity AssetDatabase to reflect changes.
  • Return detailed syntax error information to aid quick debugging.

Quick Start

Provide the target file path and the C# code content to create or update the script using the unity-mcp-cli tool

Frequently Asked Questions about script-update-or-create

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Unity C# script at a specific path and ensure it compiles?

You can update an existing Unity C# script by providing its file path and the new code content. The tool overwrites the file, refreshes the AssetDatabase, and reports any compilation errors that occur.

Why does my Unity script not reflect changes after updating the file?

The Unity AssetDatabase.Refresh() call is required to force the Editor to reimport modified C# files. This Skill triggers that refresh automatically after writing your script content to the specified path.

Can I get syntax error details when writing a Unity C# script?

Yes, the tool reports detailed syntax errors after writing the C# script file and calling AssetDatabase.Refresh(). This allows you to identify and fix compilation issues immediately during the creation or update process.

What's the best way to automate adding a C# script to a Unity project?

Automating C# script creation in Unity requires writing the file to disk and triggering AssetDatabase.Refresh(). This Skill performs both actions, ensuring the Unity Editor imports and compiles the new script automatically.

Does this Unity script update tool work with existing C# files?

Yes, the tool updates existing C# files by overwriting the content at the specified path. It then calls AssetDatabase.Refresh() to ensure Unity recompiles the modified script and reports any resulting syntax errors.

What inputs do I need to create a Unity C# script with this tool?

To create or update a Unity C# script, you must provide the target filePath and the C# code content. The tool uses these inputs to write the file, call AssetDatabase.Refresh(), and report any syntax errors.