Logo: Uloop Execute Dynamic Code

Uloop Execute Dynamic Code

Communautéit
hatayama
uloop-execute-dynamic-code

Execute C# with Unity APIs when existing uloop tools cannot inspect or edit enough. Use for reachable scene/component state, scene/prefab/menu automation, and PlayMode checks

Add to TypingMind

Iwwersiicht

Editeurhatayama
Repositoryunity-cli-loop
Skill-Nummuloop-execute-dynamic-code
Stären
578
Forks
49
Matgeliwwert Dateien
2
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    hatayama huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Uloop Execute Dynamic Code an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/hatayama/unity-cli-loop/tree/main/.agents/skills/uloop-execute-dynamic-code
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/hatayama/unity-cli-loop.git /tmp/unity-cli-loop
mkdir -p .claude/skills
cp -r /tmp/unity-cli-loop/.agents/skills/uloop-execute-dynamic-code .claude/skills/uloop-execute-dynamic-code
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Uloop Execute Dynamic Code an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Uloop Execute Dynamic Code automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Uloop Execute Dynamic Code net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Task

Run focused C# snippets in the active Unity Editor with uloop execute-dynamic-code.

For basic selected GameObject discovery or property inspection, use find-game-objects --search-mode selected first. Use this tool when the built-in inspection tools are not enough or when you need to modify Unity state.

This tool can inspect reachable Unity state — GameObjects, components, public properties, static values, method results — but it cannot read local variables or intermediate calculations inside an already-running method. When those values matter, follow the uloop-pause-point skill: a pause point's CapturedVariables carries the locals, parameters, and instance fields at that line with no code edit or recompile, and while Unity stays paused UloopPausePoint.TryGetCapturedValue(name) gives this tool live captured references (it returns (bool Found, object Value); see its references/captured-variables.md). That skill also covers the reverse combination — registering an EditorApplication.update watcher from this tool that freezes Unity on the first frame a runtime condition holds. Never poll or sleep inside a snippet; the body runs synchronously on the main thread.

Live state injection: when a running PlayMode session is merely in the wrong state — a stuck end-to-end scenario, a camera angle a raycast can never hit, a private flag blocking the path under test — fix the state instead of the code: write the field directly from this tool (reflection reaches private fields) and steer the session onward. Nothing recompiles and no domain reload happens, so the session's in-memory state survives intact. The snippet is a one-off diagnostic that never lands in source files, so project rules restricting reflection in production code are not violated.

Parameters

ParameterTypeDefaultDescription
--codestring-Inline C# statements to execute. Direct statements only; return is optional, and using directives may appear at the top of the snippet.
--parametersobject-Shell-quoted JSON object literal for reusing a snippet with varying data or keeping values outside the code. Values are exposed as parameters["param0"], parameters["param1"], and so on. Omit for most snippets; never pass a JSON string value.
--wait-for-domain-reloadflag-Wait for Domain Reload recovery after snippets that intentionally trigger Unity script reload or import work. Omit for normal inspection and editor-state workflows.
--yield-to-foreground-requestsflag-Allow foreground requests to preempt this execution

CLI-only flag, accepted instead of a schema parameter:

  • --code-file <path>: Read the C# statements from a file instead of --code. Use this when the active shell or launcher cannot preserve inline code exactly. Exactly one of --code or --code-file is required; combining them is an error.

Code Rules

Write direct statements from your own Unity API knowledge — no class/namespace/method wrappers. Return is optional. await works, and a returned Task is awaited: its value becomes Result, its exception a failure.

csharp
using UnityEngine;
float x = Mathf.PI;
return x;

Prefer terminal commands for file operations.

A type an active hot reload introduced is nameable here; write its full name. Members hot reload added to a type are not; see the hot-reload skill's added-field-wiring.md.

This snippet runs in the Editor execution context: Screen.width and Screen.height are Editor pixels, not the Game View resolution. For a ray through the Game View center, use cam.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f)).

Known transpiler constraints

On CS8421, CS8820, or a surprising type error around numeric literals (e.g. Color32 needing (byte)255), read references/transpiler-constraints.md — snippets hoist literals in ways that constrain static local functions and lambdas.

Shell Quoting

In zsh/bash, single-quote the whole snippet so C# double quotes pass through unchanged: --code 'return "hi";'. If a snippet fails to parse, gets mangled by the shell, or you are on Windows/PowerShell, read references/shell-quoting.md — or switch to --code-file.

When To Use Input Simulation Tools Instead

Calling UI handlers or runtime methods directly from a snippet is the better choice for targeted automation, direct state control, or quick diagnostics. Switch to the dedicated input tools only when the input route itself is part of what you need to verify:

ScenarioRecommended toolWhy
Verify that a uGUI element responds through the real EventSystem pointer pathsimulate-mouse-uiFires PointerDown / PointerUp / PointerClick / drag events through EventSystem raycasts instead of bypassing the UI input route.
Test gameplay that reads Mouse.current, button state, delta, or scrollsimulate-mouse-inputInjects Input System mouse state into Mouse.current so game code observes it like player input. Requires the New Input System (Input System Package (New) or Both); when that is unavailable, prefer an execute-dynamic-code workaround instead of changing project settings just to use the tool.
Jump straight to a known callback, invoke a method, inspect state, or set up a test preconditionexecute-dynamic-codeDirect automation without reproducing the full input pipeline.
Drive custom runtime behavior that does not map cleanly to the built-in input toolsexecute-dynamic-codeCalls project-specific methods and prototypes one-off flows immediately.

Output

Returns JSON:

  • Success: boolean — overall execution success
  • Result: string — value of the snippet's return statement (empty when omitted)
  • Logs: string[] — execution messages from the dynamic-code tool; read Unity Console Debug.Log output with get-logs
  • PartialResults (object, optional): values that a snippet explicitly saves before it completes or fails
  • CompilationErrors: object[] — Roslyn diagnostics with Message, Line, Column, ErrorCode, optional Hint and Suggestions
  • Error / ErrorMessage: string — top-level failure summary (empty on success)
  • UpdatedCode: string|null — the wrapped form actually compiled (handy when debugging using-statement reordering)
  • DiagnosticsSummary: string|null — compact summary when diagnostics are available
  • Diagnostics: object[] — structured diagnostics; same shape as CompilationErrors, usually populated together with it
  • Warning (string, optional): Set when Play Mode is running while the Unity Editor is unfocused. Progress may be throttled; run uloop focus-window, or use the pause-point --await/--trigger flow instead of polling for progress.

To retain an intermediate value across a later exception, opt in before the risky code:

csharp
UloopDynamicCodePartialResults.Set("completedSteps", completedSteps);

PartialResults contains only values explicitly saved this way. Ordinary local variables cannot be recovered after an exception unwinds the snippet. A cancellation before the snippet produces an execution result also returns no PartialResults.

On Success: false, inspect CompilationErrors first. If empty, read ErrorMessage (and Logs for extra context) — the failure may be a runtime exception, cancellation, or an "execution in progress" rejection, all of which return empty CompilationErrors. Both EditMode and PlayMode are supported — the snippet runs in whichever mode the Editor is in.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Uloop Execute Dynamic Code?

Execute C# with Unity APIs when existing uloop tools cannot inspect or edit enough. Use for reachable scene/component state, scene/prefab/menu automation, and PlayMode checks

Firwat Uloop Execute Dynamic Code op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Uloop Execute Dynamic Code besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Uloop Execute Dynamic Code an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/hatayama/unity-cli-loop/tree/main/.agents/skills/uloop-execute-dynamic-code an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Uloop Execute Dynamic Code benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Uloop Execute Dynamic Code benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Uloop Execute Dynamic Code domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Uloop Execute Dynamic Code gratis?

Jo. hatayama huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇