— No reviews yet
0 installs
7 views
0.0% view→install
Install
$ agentstack add skill-nowsprinting-unity-coding-skills-edit-scene ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Are you the author of Edit Scene? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claimAbout
Guide for creating and editing Unity scene files in Unity projects.
Rules
- Do not directly Edit or Write
.unityor.prefabfiles. Instead, write an editor script underAssets/Editor/and execute it in Unity to create or update the scene or prefab — those carry GameObject/Prefab-instance structure that is unsafe to author by hand. - Editor scripts must always end with
EditorSceneManager.SaveScene(orPrefabUtility.SaveAsPrefabAssetfor prefabs). Treat "no dirty scenes/assets at script exit" as a hard postcondition. - Scene:
EditorSceneManager.SaveScene(scene, path)(new) orEditorSceneManager.SaveScene(scene)(existing). The return value istrueon success. - Prefab:
PrefabUtility.SaveAsPrefabAsset(go, path). When editing viaLoadPrefabContents, always pair withSaveAsPrefabAsset→UnloadPrefabContents. - When the script also creates side-effect assets (Materials, ScriptableObjects, etc.), call
AssetDatabase.SaveAssets()after the per-object saves to flush pending writes. - Before running an editor script, check if the editor is in Play Mode using the
mcp__jetbrains__unity_play_controltool. If it is, stop it first — Play Mode may skip recompilation, leaving stale code active. - After modifying code, confirm compilation success using the
mcp__jetbrains__get_unity_compilation_resulttool before running. - To determine which assembly an editor script belongs to, run
${CLAUDE_SKILL_DIR}/scripts/resolve-assembly.sh. It walks up directories to find the nearest.asmdef; if none is found, it falls back toAssembly-CSharp-Editor(path contains/Editor/) orAssembly-CSharp. - Prefer the
mcp__jetbrains__run_method_in_unitytool (MCP Server Extension for Unity) for execution. Define apublic staticmethod in the script (adding[MenuItem("Tools/...")]is optional) and invoke it directly viamcp__jetbrains__run_method_in_unity. Only fall back toexecute_run_configurationor other alternatives whenmcp__jetbrains__run_method_in_unityis unavailable. - For uGUI buttons and text, use the legacy variants (
UnityEngine.UI.Button/UnityEngine.UI.Text). Do not use TextMeshPro unless the user explicitly requests it. - Apply context-menu-equivalent defaults when creating uGUI components (see Resources below).
- Give every GameObject the user operates (buttons, toggles, input fields, etc.) a name that makes its hierarchy path unique within the scene/prefab. Otherwise, automated tests cannot identify the GameObject.
Gotchas
- Never call two Unity Editor tools in parallel.
mcp__jetbrains__unity_play_control,mcp__jetbrains__get_unity_compilation_result,mcp__jetbrains__run_method_in_unity, andmcp__jetbrains__run_unity_testsmust be called strictly one at a time — always wait for each call to return before making the next one. Calling them concurrently causes domain-reload conflicts that result in "canceled" or "did not connect within 30 seconds" errors. - When a Unity Editor tool returns
errororcanceled, wait 10 seconds before retrying. Domain reload typically takes several seconds; immediate retry hits the same in-flight reload and fails again. Do not switch tools in the meantime (e.g., callingmcp__jetbrains__unity_play_controlto verify state) — that just compounds the multiplexed calls. If the same tool returnserrororcanceledon two consecutive attempts (with the 10-second wait between them), stop and consult the user instead of retrying further. .metafiles follow an asymmetric commit rule. Never create them manually — Unity generates them automatically. Scene/prefab files (.unity,.prefab) and their referenced assets (materials, SOs, etc.) must be committed (required for GUID resolution); editor scripts (Assets/Editor/*.cs) and their.metamust not be committed — orphaned metas break the other checkout if the script is absent. Do not delete them; leave them for the user to remove manually. Do not add them to.gitignore; the user excludes them at commit time.
Scene lifecycle
- New scene: First determine whether the scene will be loaded additively or as a single scene, then choose the setup accordingly.
- Additive (
LoadSceneMode.Additive):EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single)— no camera or light needed. - Single (
LoadSceneMode.Single):EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single)— Main Camera and Directional Light are included automatically; do not add a camera manually. - In both cases, place additional GameObjects via
ObjectFactory.CreateGameObjectand save withEditorSceneManager.SaveScene(scene, "Assets/YourFeature/Scenes/XxxScene.unity"). - Edit existing scene:
EditorSceneManager.OpenScene(path, OpenSceneMode.Single)→ make changes →EditorSceneManager.SaveScene(scene). - New prefab: build the GameObject hierarchy in memory, then save with
PrefabUtility.SaveAsPrefabAsset(go, "Assets/YourFeature/Prefabs/XxxPrefab.prefab"). - Edit existing prefab: open with
PrefabUtility.LoadPrefabContents(path)→ modify →PrefabUtility.SaveAsPrefabAsset(root, path)→PrefabUtility.UnloadPrefabContents(root). - Use
ObjectFactory.CreateGameObject/ObjectFactory.AddComponentso Undo history and Presets are applied automatically. - Parent child objects with
transform.SetParent(parent, worldPositionStays: false).
Resources
- Before writing or modifying any editor script that creates or manipulates uGUI components: Read
${CLAUDE_SKILL_DIR}/resources/ugui.md
Troubleshooting
- The
mcp__jetbrains__run_method_in_unitytool is not available or fails with a connection error: Read${CLAUDE_SKILL_DIR}/resources/troubleshooting-run-method-in-unity.md
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: nowsprinting
- Source: nowsprinting/unity-coding-skills
- License: Unlicense
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.