计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
hz-unity-tmp-resources【效率与协作】Imports and configures TextMesh Pro Essential Resources for Unity projects targeting Meta VR and Horizon OS. Use when setting up TMP UI, fixing missing TMP materials or fonts, or resolving pink/magenta TMP text.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill automatically when any of the following are detected:
LiberationSans SDF, TMP Settings, or missing TMP materialsAssets/TextMesh Pro/Resources/ folder does not existEvery step below runs through unity-cli against an open Editor — no C# required. Confirm one is
reachable first, and pass --project-path <proj> when more than one may be running:
unity status --format json # look for state "ready"
Connecting, --project-path, and Safe Mode recovery are covered by the unity-cli skill. On a
Unity MCP server instead, see references/unity-mcp-fallback.md.
unity command find_assets --type TMP_Settings --format json
unity command find_assets --name "LiberationSans SDF" --format json
find_assets needs at least one of --type / --name / --label — with none it fails
"At least one of type, name, or label is required." Any one of them is enough on its own;
--search_in only narrows the scope and is optional.
Read data.result.count; 0 for both means the resources are not imported. If they are found,
stop here — no action needed.
Two ways count: 0 is not an error, so always judge on count rather than success:
--type (TMP not imported, so TMP_Settings is not a loaded type) returns
success with count: 0 — which is exactly the "not imported" signal here.--search_in folder also returns success with count: 0.IMPORTANT: The TMP import opens a modal Unity dialog that requires manual user interaction. It cannot be fully automated.
unity command menu --path "Window/TextMeshPro/Import TMP Essential Resources"
After executing, you MUST:
The modal blocks the Editor, so expect this request to time out or return late — that is the dialog waiting on the user, not a failure.
After the user confirms, re-run the checks and require both assets to exist:
unity command find_assets --name "LiberationSans SDF" --format json
unity command find_assets --type TMP_Settings --format json
A non-zero count for both is the bar. If either is 0, the import did not complete — do not
proceed to UI work. Editor import is only half the story: after deploying, confirm text actually
renders with metavr capture screenshot (pink/magenta text means the TMP shaders need a reimport —
see Troubleshooting).
Force a reimport of the TMP shaders. This one needs C# (there is no reimport command), so run it via
run_script with the file outside Assets/:
// AgentScripts/ReimportTmpShaders.cs
using UnityEditor;
public static class ReimportTmpShaders
{
public static string Run()
{
var guids = AssetDatabase.FindAssets("t:Shader TextMeshPro");
foreach (var guid in guids)
AssetDatabase.ImportAsset(AssetDatabase.GUIDToAssetPath(guid), ImportAssetOptions.ForceUpdate);
return quot;Reimported {guids.Length} TMP shaders.";
}
}
unity command run_script --file AgentScripts/ReimportTmpShaders.cs --entry ReimportTmpShaders.Run --format json
--file resolves against the project root, and keeping the script outside Assets/ means writing it
triggers no asset import or domain reload.
If Window/TextMeshPro/Import TMP Essential Resources is not available:
Resources may already be imported — run Step 1 to check.
TMP package may not be installed:
unity command package_add --identifier com.unity.textmeshpro --confirm true --wait true --format json
unity command package_list --scope installed --format json # verify
--wait true blocks until the package resolves. A successful add forces a recompile and domain
reload, so treat anything after it as a separate command rather than chaining in one script.
This skill handles importing TMP resources. For VR-specific UI configuration (canvas setup, text sizing, viewing distances), use the meta-quest-ui skill after TMP resources are imported.