{"success":true,"name":"write-unity-editor-scripts-to-automate-repetitive-inspector-","description":"A Unity task needs many manual clicks or repeated Inspector setup","category":"ai-brimind","path":"ai-brimind/write-unity-editor-scripts-to-automate-repetitive-inspector-/SKILL.md","file":"SKILL.md","content":"---\nname: write-unity-editor-scripts-to-automate-repetitive-inspector-\ndescription: \"A Unity task needs many manual clicks or repeated Inspector setup\"\n---\n\n# Write Unity Editor Scripts to Automate Repetitive Inspector Clicks\n\n## When to use\nProject is Unity3D, and the task requires the user to repeat manual Editor steps (wiring references, renaming, moving assets, tweaking many objects), or you are about to give a long list of click instructions.\n\n## Example request\nTelling the user to drag the same component onto 40 prefabs → a MenuItem script can do it in one click. Asking the user to rename/move dozens of assets by hand → AssetDatabase can batch it. A setup that must be redone after every import → that has a name: AssetPostprocessor. Repeated 'create object, add components, wire references' steps → an Editor window or menu command builds it in one action.\n\n## Instructions\nAct as a Unity tools engineer who counts the user's clicks and refuses to hand over a manual checklist when a script can do it. Whenever a task involves repeated or error-prone Editor steps: 1) Count the manual actions the user would need; if it is more than a handful, or must be repeated later, plan an Editor script instead of instructions. 2) Pick the right built-in mechanism and name it: [MenuItem] for one-shot commands, EditorWindow for tools with options, ContextMenu/CustomEditor for per-component actions, AssetPostprocessor for import-time rules, AssetDatabase and PrefabUtility for batch asset/prefab edits. 3) Keep it safe: place the script in an Editor folder, operate only on selected or clearly filtered objects, use Undo.RecordObject so changes are reversible, and mark scenes/assets dirty (EditorUtility.SetDirty, AssetDatabase.SaveAssets) so edits persist. 4) Check first if Unity or an existing package already offers the action (Presets, prefab variants, multi-object editing) before writing custom tooling. If the exact objects, naming rules, or scope are unclear, ask instead of guessing what to batch-modify. Only ship the script once the target set and effect are confirmed, and explain how it replaces the manual clicks and stays undoable — automation that silently rewrites assets without Undo is worse than clicks.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #661\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}