fix: declare required Unity module dependencies#1122
Conversation
MCPForUnity.Runtime uses Texture2D.EncodeToPNG, Physics2D, and ScreenCapture APIs. Declaring their built-in modules prevents Unity projects that do not already enable those modules from failing script compilation. Co-authored-by: Codex <noreply@openai.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds missing built-in Unity module dependencies to the MCP for Unity package manifest:
com.unity.modules.imageconversioncom.unity.modules.physics2dcom.unity.modules.screencaptureRoot Cause
MCPForUnity.Runtimedirectly uses APIs from these modules:Texture2D.EncodeToPNG()from Image ConversionPhysics2Dfrom Physics 2DScreenCapturefrom Screen CaptureProjects that do not already enable these built-in modules can fail script compilation after installing the package.
Validation
Validated in a Unity
6000.3.15f1project that originally failed compilingMCPForUnity.Runtimewith missing module references. After declaring the dependencies, Unity Package Manager resolved the three built-in modules and batchmode script compilation completed successfully.