Export a package to reproduce a mod issue
中文 | English
Run this command at the repository root to replay the examples through the local Unity MCP.
python Docs/Manual/manual/tools/tutorials.py run send-mod-for-debugging
Click to expand MCP actionsClick to collapse MCP actions
Prepare the teaching sample. The recipe provides ${variables}.
{
"variables": {
"payload": "${fixture}/TutorialDebugVehicle.asset",
"pipeline": "${fixture}/TutorialDebugPipeline.asset",
"unitypackage": "Temp/Docs_${runId}_Export.unitypackage"
},
"calls": [
{
"tool": "invoke",
"arguments": {
"path": "static:UnityEditor.AssetDatabase/CreateFolder",
"args": [
"${fixtureParent}",
"${folder}"
]
},
"expect": {
"contains": "(String)"
}
}
]
}
- Record the game and SDK versions, build target, steps to reproduce, expected behavior, and actual behavior. Keep the relevant runtime log.
- In Unity's Project window, select the affected VehicleData and mod build pipeline. Choose Assets → Export Package and tick Include dependencies. Review the asset list and export the files needed to reproduce the issue.
Click to expand MCP actionsClick to collapse MCP actions
[
{
"tool": "invoke",
"arguments": {
"path": "static:UnityEditor.AssetDatabase/CreateAsset",
"args": [
"@static:UnityEngine.ScriptableObject/CreateInstance(ShanghaiWindy.Core.VehicleTextData)",
"${payload}"
]
},
"expect": {
"contains": "OK:"
}
},
{
"tool": "invoke",
"arguments": {
"path": "static:UnityEditor.AssetDatabase/CreateAsset",
"args": [
"@static:UnityEngine.ScriptableObject/CreateInstance(ShanghaiWindy.Core.ModPackageBuildPiplineData)",
"${pipeline}"
]
},
"expect": {
"contains": "OK:"
}
},
{
"tool": "invoke",
"arguments": {
"path": "asset:${pipeline}/linkedObjects/Add",
"args": [
"@asset:${payload}"
]
},
"expect": {
"contains": "OK:"
}
},
{
"tool": "invoke",
"arguments": {
"path": "static:UnityEditor.EditorUtility/SetDirty",
"args": [
"@asset:${pipeline}"
]
},
"expect": {
"contains": "OK:"
}
},
{
"tool": "invoke",
"arguments": {
"path": "static:UnityEditor.AssetDatabase/SaveAssets",
"args": []
},
"expect": {
"contains": "OK:"
}
},
{
"tool": "invoke",
"arguments": {
"path": "static:ShanghaiWindy.Core.AssetBundleManager/LuaEnv/DoString",
"args": [
"local U, E, S = CS.UnityEngine, CS.UnityEditor, CS.System\nlocal files = S.Array.CreateInstance(typeof(S.String), 2)\nfiles:SetValue('${payload}', 0)\nfiles:SetValue('${pipeline}', 1)\nlocal options = S.Enum.Parse(typeof(E.ExportPackageOptions), 'Recurse, IncludeDependencies')\nlocal output = S.IO.Path.GetFullPath('${unitypackage}')\nassert(E.AssetDatabase.LoadMainAssetAtPath('${payload}') ~= nil)\nE.AssetDatabase.ExportPackage(files, output, options)\nlocal gzip = S.IO.File.ReadAllBytes('${unitypackage}')\nassert(#gzip > 100 and gzip:byte(1) == 31 and gzip:byte(2) == 139, 'Not a Unity gzip archive')\nreturn 'Local Unity package exported'\n",
"export-debug-package",
"null"
]
},
"expect": {
"contains": "Local Unity package exported"
}
}
]
- Send the
.unitypackageand reproduction notes through your existing support channel.